-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.js
51 lines (50 loc) · 1.32 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
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue2'
import * as path from "path";
import {viteExternalsPlugin} from 'vite-plugin-externals';
import viteEslintPlugin from 'vite-plugin-eslint';
export default defineConfig(({command, mode}) => {
process.env = {...process.env, ...loadEnv(mode, process.cwd(), '')};
const port = process.env.DEV_PORT || 3000;
return {
base: command === 'serve' ? '' : '/dist/',
// publicDir: './src/web/assets/analytics/dist',
root: "./src/web/assets/analytics/",
build: {
emptyOutDir: true,
manifest: true,
sourcemap: true,
// outDir: './src/web/assets/analytics/dist/',
rollupOptions: {
input: path.resolve('./src/web/assets/analytics/src/main.js'),
},
},
// define: {
// __VUE_OPTIONS_API__: true,
// __VUE_PROD_DEVTOOLS__: false,
// },
resolve: {
alias: {
'@': path.resolve('./src/web/assets/analytics/src/'),
},
// extensions: ['.vue', '.js']
},
plugins: [
vue(),
viteExternalsPlugin({
'vue': 'Vue',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios'
}),
viteEslintPlugin({
cache: false,
fix: true,
}),
],
server: {
host: '0.0.0.0',
port,
}
}
})