-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
61 lines (60 loc) · 1.58 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
61
/// <reference types="vitest" />
import {defineConfig} from 'vite';
import vue from '@vitejs/plugin-vue';
import * as path from "path";
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VueI18nPlugin({
include: [path.resolve(__dirname, './frontend/locales/**')],
}),
],
mode: 'production',
define: {
'process.env.NODE_ENV': process.env.NODE_ENV === 'test' ? '"test"' : '"production"',
},
build: {
lib: {
// what to build
name: 'OsisComment',
entry: 'frontend/main.ts',
formats: ['umd'],
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled into library
external: ['vue', 'vue-i18n', '@vue/runtime-dom'],
output: {
// Provide global variables to use in the UMD build for externalized deps
globals: {
'vue': 'Vue',
'vue-i18n': 'VueI18n',
'@vue/runtime-dom': 'Vue',
},
entryFileNames: "osis-comment.umd.min.js",
assetFileNames: "osis-comment.[ext]",
},
},
},
test: {
environment: 'jsdom',
setupFiles: ['frontend/test.setup.ts'],
coverage: {
provider: 'istanbul',
all: true,
enabled: true,
perFile: true,
branches: 100,
statements: 100,
include: ['frontend'],
exclude: [
"frontend/locales/",
"frontend/components/ckeditor.js",
"frontend/node_modules/",
"frontend/.storybook",
"frontend/**/*.stories.{ts,js}",
],
},
},
});