-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
52 lines (50 loc) · 1.26 KB
/
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
44
45
46
47
48
49
50
51
52
/* eslint-disable import/no-extraneous-dependencies */
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import { VarletImportResolver } from '@varlet/import-resolver'
import components from 'unplugin-vue-components/vite'
import autoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vite'
// import { analyzer } from 'vite-bundle-analyzer'
import svgLoader from 'vite-svg-loader'
import vitePluginAutoRouter from './build/vite/vite-plugin-auto-router'
import vitePluginEjsMpa from './build/vite/vite-plugin-ejs-mpa'
export default defineConfig({
base: './',
build: {
minify: 'terser'
},
plugins: [
components({
resolvers: [VarletImportResolver()]
}),
autoImport({
resolvers: [VarletImportResolver({ autoImport: true })]
}),
svgLoader(),
vitePluginAutoRouter({
mode: 'mpa',
pagesDir: 'modules'
}),
vitePluginEjsMpa(),
vue()
],
define: {
'process.env': {
__VUE_OPTIONS_API__: false,
__VUE_PROD_DEVTOOLS__: false,
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
BUILD_TIME: new Date().toLocaleString(),
VUE_BASE_URL: '/'
}
},
server: {
host: '0.0.0.0'
},
resolve: {
extensions: ['.vue', '.mjs', '.js', '.cjs', '.ts', '.jsx', '.tsx', '.json'],
alias: {
'@': resolve('src')
}
}
})