-
Notifications
You must be signed in to change notification settings - Fork 56
/
vite.config.ts
51 lines (48 loc) · 1.17 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
/// <reference types="vitest" />
import vue2 from '@vitejs/plugin-vue2';
import vue2Jsx from '@vitejs/plugin-vue2-jsx';
import { resolve } from 'path';
import { resolveWithAlias } from 'path-ops';
import { defineConfig } from 'vite';
const alias = {
'@': resolve('src'),
};
// https://vitejs.dev/config/
export default defineConfig({
base: '/el-select-tree/',
plugins: [
vue2(),
vue2Jsx({
// fork from @vue/babel-preset-app
babelPlugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
'@babel/plugin-proposal-class-properties',
],
}),
],
resolve: {
alias,
extensions: ['.vue', '.js', '.ts', '.jsx', '.tsx', '.json'],
},
css: {
preprocessorOptions: {
scss: {
// ignore external sass warnings for "10px / 2px"
quietDeps: true,
// resolve start path for "~", like: "~external/style/var.scss"
importer: (url: string) => {
return {
file: resolveWithAlias(
url.startsWith('~') ? url.slice(1) : url,
alias,
),
};
},
},
},
},
// https://vitest.dev/config/
test: {
dir: 'src',
},
});