forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.mts
81 lines (79 loc) · 1.73 KB
/
vite.config.mts
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';
import { type UserConfig } from 'vitest';
import { defineConfig as defineVitestConfig } from 'vitest/config';
import components from 'unplugin-vue-components/vite';
import icons from 'unplugin-icons/vite';
import iconsResolver from 'unplugin-icons/resolver';
export const vitestConfig = defineVitestConfig({
test: {
silent: true,
globals: true,
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
...(process.env.COVERAGE_ENABLED === 'true'
? {
coverage: {
enabled: true,
provider: 'v8',
reporter: process.env.CI === 'true' ? 'cobertura' : 'text-summary',
all: true,
},
}
: {}),
css: {
modules: {
classNameStrategy: 'non-scoped',
},
},
},
}) as UserConfig;
export default mergeConfig(
defineConfig({
plugins: [
vue(),
icons({
compiler: 'vue3',
autoInstall: true,
}),
components({
dirs: [],
dts: false,
resolvers: [
iconsResolver({
prefix: 'icon'
})
]
}),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'n8n-design-system': resolve(__dirname, 'src'),
lodash: 'lodash-es',
},
},
build: {
lib: {
entry: resolve(__dirname, 'src', 'main.ts'),
name: 'N8nDesignSystem',
fileName: (format) => `n8n-design-system.${format}.js`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue'],
output: {
exports: 'named',
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: 'Vue',
},
},
},
},
}),
vitestConfig,
);