-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
43 lines (35 loc) · 960 Bytes
/
vite.config.ts
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
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import alias from '@rollup/plugin-alias'
import path from 'path'
// import liveReload from 'vite-plugin-live-reload'
import { v4wp } from '@kucrut/vite-for-wp'
export default {
plugins: [
alias(),
react(),
tsconfigPaths(),
// liveReload(__dirname + '/**/*.php'), // Optional, if you want to reload page on php changed
v4wp({
input: 'js/src/main.tsx', // Optional, defaults to 'src/main.js'.
outDir: 'js/dist', // Optional, defaults to 'dist'.
}),
],
// build: {
// rollupOptions: {
// output: {
// // 修改入口檔案名稱
// entryFileNames: 'index.js',
// // 修改代碼分割後的檔案名稱
// chunkFileNames: '[name]-[hash].js',
// // 修改資源檔案名稱
// assetFileNames: '[name]-[hash].[ext]',
// },
// },
// },
resolve: {
alias: {
'@': path.resolve(__dirname, 'js/src'),
},
},
}