forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.mts
More file actions
68 lines (66 loc) · 1.62 KB
/
Copy pathvite.config.mts
File metadata and controls
68 lines (66 loc) · 1.62 KB
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
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';
import icons from 'unplugin-icons/vite';
import { vitestConfig } from '@n8n/vitest-config/frontend';
import svgLoader from 'vite-svg-loader';
import { lucideIconsPlugin } from './src/icons/lucide/vite';
const packagesDir = resolve(__dirname, '..', '..', '..');
export default mergeConfig(
defineConfig({
plugins: [
vue(),
lucideIconsPlugin(),
svgLoader({
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// disable a default plugin
cleanupIds: false,
// preserve viewBox for scalability
removeViewBox: false,
},
},
},
],
},
}),
icons({
compiler: 'vue3',
autoInstall: true,
}),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'@n8n/design-system': resolve(__dirname, 'src'),
'@n8n/composables(.*)': resolve(packagesDir, 'frontend', '@n8n', 'composables', 'src$1'),
'@n8n/utils(.*)': resolve(packagesDir, '@n8n', 'utils', 'src$1'),
},
},
build: {
lib: {
entry: resolve(__dirname, 'src', 'index.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,
);