-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.js
40 lines (39 loc) · 1.11 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
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
rollupOptions: {
input: {
widget: fileURLToPath(new URL('./src/main.js', import.meta.url)),
style: './src/assets/styles/main.css'
},
output: {
inlineDynamicImports: false,
entryFileNames: '[name].js', // for JS files
chunkFileNames: '[name].js', // for code-splitted chunks
assetFileNames: '[name].[ext]' // for other assets
},
},
},
// Configuration for development server and preview (will you use another entry pointe dev.js to handle this as normal SPA application )
server: {
open: true,
port: 5137,
entry: fileURLToPath(new URL('./src/dev.js', import.meta.url))
},
// Ensure preview mode is correctly handled
preview: {
open: true,
port: 5137,
entry: fileURLToPath(new URL('./src/dev.js', import.meta.url))
}
})