-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
53 lines (50 loc) · 1.1 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
/// <reference types="vitest" />
import { resolve } from "path"
import { defineConfig } from "vite"
import {createVuePlugin} from 'vite-plugin-vue2'
import PkgConfig from 'vite-plugin-package-config'
import ScriptSetup from 'unplugin-vue2-script-setup/vite'
import Inspect from 'vite-plugin-inspect'
import legacy from '@vitejs/plugin-legacy'
const alias = [
{ find: /^~/, replacement: '' },
// { find: 'vue', replacement: 'vue/dist/vue.runtime.esm.js' },
{
find: '@',
replacement: resolve(__dirname, 'src'),
},
]
export default defineConfig({
base: '/',
root: './',
publicDir: './static',
build: {
outDir: './dist',
},
resolve: {
alias,
dedupe: ['vue-demi'],
},
plugins: [
createVuePlugin({
jsx: true,
}),
PkgConfig(),
Inspect(),
ScriptSetup(),
legacy({
targets: ['ie >= 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime']
}),
],
optimizeDeps: {
// exclude: ['axios'],
},
test: {
environment: 'happy-dom',
setupFiles: [
'vitest.setup.ts',
],
globalSetup: 'vitest.global-setup.ts',
},
})