generated from armandsalle/vite-javascript-webflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
50 lines (49 loc) · 1.07 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { defineConfig } from 'vite'
import eslintPlugin from 'vite-plugin-eslint'
import { copy } from 'copy-vite-plugin'
// vite.config.js
export default defineConfig({
plugins: [
eslintPlugin({ cache: false }),
copy({
pattern: [
{ from: 'src/_headers', to: '_headers' }
]
})
],
server: {
host: 'localhost',
cors: '*',
hmr: {
host: 'localhost',
protocol: 'ws',
},
},
build: {
minify: true,
manifest: true,
cssCodeSplit: true,
rollupOptions: {
input: {
global: './src/global.js',
home: './src/home.js',
studio: './src/studio.js',
workdetail: './src/workdetail.js',
faces: './src/faces.js',
facesdetail: './src/facesdetail.js',
},
output: {
format: 'es',
entryFileNames: '[name].js',
esModule: true,
compact: true,
globals: {
jquery: '$',
},
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
},
external: ['jquery'],
},
},
})