-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
65 lines (55 loc) · 1.48 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
53
54
55
56
57
58
59
60
61
62
63
64
65
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {viteMockServe} from "vite-plugin-mock";
import {AntDesignVueResolver} from "unplugin-vue-components/resolvers";
import Components from 'unplugin-vue-components/vite';
import {baseConfig} from "./config/config";
import * as path from "path";
import vueJsx from '@vitejs/plugin-vue-jsx'
import wasm from "vite-plugin-wasm";
// https://vitejs.dev/config/
export default defineConfig({
base: baseConfig.baseUrl,
plugins: [
vue({
script: {
}
}),
viteMockServe({
mockPath: 'core/mock',
// @ts-ignore
enable: true,
watchFiles: true,
}),
Components({
resolvers: [
AntDesignVueResolver({
importStyle: false, // css in js
}),
],
}),
// vue-jsx插件
vueJsx({}),
wasm(),
],
resolve: {
alias: {
'@src': path.resolve(__dirname, 'src'),
'@core': path.resolve(__dirname, 'core'),
},
//配置文件扩展名
extensions: [".ts", ".mjs", ".js", ".jsx", ".tsx", ".json"],
},
css: {
/* CSS 预处理器 */
preprocessorOptions: {
scss: {
additionalData: '@import "src/assets/style/mixin.scss";'
}
}
},
build: {
cssMinify: true,
outDir: baseConfig.outDir,
}
})