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