-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
48 lines (45 loc) · 962 Bytes
/
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
import path, { resolve } from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
const devOrTest = process.argv.some(i => ['test', 'test'].includes(i));
/**
* https://vitejs.dev/config/
* @type {import('vite').UserConfig}
*/
export default defineConfig({
base: './',
plugins: [
vue(),
vueJsx(),
],
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment',
jsxInject: 'import { h } from "vue"',
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/assets/style/comm.scss";',
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
server: {
host: '0.0.0.0',
port: 8888,
},
build: {
terserOptions: {
compress: {
pure_funcs: devOrTest ? null : ['console.log', 'console.warn'],
},
},
outDir: resolve(__dirname, 'dist/'),
},
});