-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
51 lines (48 loc) · 1.19 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 vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import { join } from 'path';
import { defineConfig, loadEnv } from 'vite';
import svgLoader from 'vite-svg-loader';
// https://vitejs.dev/config/
export default ({ mode }) => {
const env = loadEnv(mode, process.cwd());
process.env = { ...process.env, ...env };
return defineConfig({
plugins: [vue(), svgLoader(), vueJsx()],
resolve: {
alias: {
'@': join(__dirname, 'src'),
'@styles': join(__dirname, 'src/styles'),
},
},
base: process.env.VITE_BASE_URL,
build: {
rollupOptions: {
output: {
entryFileNames: 'assets/[name].js',
assetFileNames: (info) => {
if (info.name.endsWith('.css')) return 'assets/[name].[ext]';
return 'assets/[name]-[hash][extname]';
},
manualChunks: null,
},
},
},
server: {
host: true,
port: 3000,
},
test: {
globals: true,
environment: 'jsdom',
coverage: {
provider: 'c8',
all: true,
},
typecheck: {
checker: 'vue-tsc',
},
},
});
};