-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
52 lines (48 loc) · 1.17 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
51
52
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'
export default defineConfig((mode) => {
// Extends 'process.env.*' with VITE_*-variables from '.env.(mode=production|development)'
process.env = {...process.env, ...loadEnv(mode, process.cwd())}
// const env = loadEnv(mode, process.cwd(), '')
const OUTPUT_DIR = './_frontend/dist'
const INPUT_DIR = './_frontend/src'
return {
plugins: [
vue(),
],
resolve: {
extensions: ['.js', '.json'],
alias: {
'@': resolve(INPUT_DIR),
'vue': 'vue/dist/vue.esm-bundler.js',
},
},
root: resolve(INPUT_DIR),
base: '/static/',
server: {
host: '0.0.0.0',
port: 5173,
open: false,
watch: {
usePolling: true,
disableGlobbing: false,
},
},
build: {
outDir: resolve(OUTPUT_DIR),
assetsDir: '',
manifest: true,
emptyOutDir: true,
target: 'es2015',
rollupOptions: {
input: {
main: resolve(`${INPUT_DIR}/main.js`),
},
output: {
chunkFileNames: undefined,
},
},
},
}
})