-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
87 lines (77 loc) · 2.29 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import * as path from 'path';
import { defineConfig } from 'vite';
import { resolve } from 'path';
import vue from '@vitejs/plugin-vue';
import WindiCSS from 'vite-plugin-windicss';
import eslintPlugin from 'vite-plugin-eslint';
import vueJsx from '@vitejs/plugin-vue-jsx';
// import viteStylelint from '@amatlash/vite-plugin-stylelint';
import { viteVConsole } from 'vite-plugin-vconsole';
import styleImport from 'vite-plugin-style-import';
import vueI18n from '@intlify/vite-plugin-vue-i18n';
import svgLoader from 'vite-svg-loader';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
// https://vant-contrib.gitee.io/vant/v3/#/zh-CN/quickstart#fang-shi-er.-zai-vite-xiang-mu-zhong-an-xu-yin-ru-zu-jian
styleImport({
libs: [
{
libraryName: 'vant',
esModule: true,
resolveStyle: (name) => `vant/es/${name}/style`,
},
],
}),
// https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx
vueJsx(),
// https://github.com/gxmari007/vite-plugin-eslint
eslintPlugin({
fix: true,
}),
// https://github.com/antfu/vite-plugin-windicss
WindiCSS(),
// https://github.com/vadxq/vite-plugin-vconsole
viteVConsole({
entry: path.resolve('src/main.ts'),
localEnabled: true,
enabled: true,
config: {
maxLogNumber: 1000,
theme: 'dark',
},
}),
// https://github.com/intlify/bundle-tools/tree/main/packages/vite-plugin-vue-i18n
vueI18n({
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
// you need to set i18n resource including paths !
include: path.resolve(__dirname, 'src/locales/**'),
}),
// https://github.com/jpkleemans/vite-svg-loader
svgLoader(),
// https://github.com/AMatlash/vite-plugin-stylelint
// viteStylelint(),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/styles/_configuration.scss";',
},
},
},
server: {
host: '0.0.0.0',
// https://cn.vitejs.dev/config/#server-proxy
proxy: {},
},
// https://cn.vitejs.dev/config/#envdir
envDir: './.env',
envPrefix: 'W6S_',
});