-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathvite.dev.config.js
More file actions
49 lines (46 loc) · 933 Bytes
/
vite.dev.config.js
File metadata and controls
49 lines (46 loc) · 933 Bytes
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
import { defineConfig } from 'vite';
import { createHtmlPlugin } from 'vite-plugin-html';
import { viteStaticCopy } from 'vite-plugin-static-copy';
export default defineConfig( {
root: './example/layer',
base: '',
server: {
port: 9009,
open: true,
},
build: {
rollupOptions: {
input: {
main: 'index.html',
},
output: {
dir: 'dist',
entryFileNames: '[name].js',
assetFileNames: '[name].css',
chunkFileNames: 'chunk-[name].js',
manualChunks: undefined,
}
}
},
plugins: [
createHtmlPlugin( {
minify: true,
entry: 'index.js', //relative to root
template: 'index.html', //relative to root
inject: {
data: {
title: 'index',
injectScript: '<script src="./index.js"></script>',
}
},
} ),
viteStaticCopy( {
targets: [
{
src: '../fonts/helvetiker_regular.typeface.json', //RELATIVE TO ROOT
dest: 'fonts'
}
]
} )
]
} );