generated from goitacademy/vanilla-app-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.js
35 lines (32 loc) · 839 Bytes
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from 'vite';
import { resolve } from 'path'
import glob from 'glob';
import injectHTML from 'vite-plugin-html-inject';
import FullReload from 'vite-plugin-full-reload';
export default defineConfig(({ command }) => {
return {
define: {
[command === 'serve' ? 'global' : '_global']: {},
},
root: resolve(__dirname, 'src'),
build: {
sourcemap: true,
outDir: '../dist',
rollupOptions: {
input: glob.sync('./src/*.html'),
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return 'vendor';
}
},
entryFileNames: 'commonHelpers.js',
},
},
},
plugins: [injectHTML(), FullReload(['./src/**/**.html'])],
server: {
port: 4044
},
};
});