-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
60 lines (55 loc) · 1.26 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import vueI18n from '@intlify/vite-plugin-vue-i18n'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { loadEnv } from 'vite'
export default defineConfig(({ mode }) => {
const ENV_DIR = '/envs'
const ENV_VARS = loadEnv(mode, process.cwd() + ENV_DIR)
return {
test: {
setupFiles: ['./tests/config.ts'],
environment: 'jsdom'
},
envDir: ENV_DIR,
build: {
lib: {
entry: path.resolve(__dirname, 'src/install.ts'),
name: 'vite-ts',
formats: ['es'],
fileName: (format) => `vite-ts.${format}.js`
},
rollupOptions: {
external: ['vue'],
output: {
exports: 'named',
globals: {
'vue': 'Vue',
}
}
},
},
plugins: [
vue({
// @ts-ignore
style: true,
css: true
}),
vueI18n({
include: path.resolve(__dirname, './src/locales/**.json'),
globalSFCScope: true,
compositionOnly: false,
}),
],
server: {
port: 8080
},
resolve: {
alias: {
"~": path.resolve(__dirname, "./src"),
"@": path.resolve(__dirname, "./src"),
},
},
}
})