2023-07-28 00:51:07 -07:00
|
|
|
import vue from '@vitejs/plugin-vue';
|
2022-04-29 06:23:41 -07:00
|
|
|
import { resolve } from 'path';
|
2022-10-25 04:46:25 -07:00
|
|
|
import { defineConfig, mergeConfig } from 'vite';
|
2024-07-23 03:30:29 -07:00
|
|
|
import components from 'unplugin-vue-components/vite';
|
|
|
|
import icons from 'unplugin-icons/vite';
|
|
|
|
import iconsResolver from 'unplugin-icons/resolver';
|
2025-02-06 02:44:30 -08:00
|
|
|
import { vitestConfig } from '@n8n/frontend-vitest-config';
|
2022-04-29 06:23:41 -07:00
|
|
|
|
2025-02-06 02:44:30 -08:00
|
|
|
const frontendDir = resolve(__dirname, '..', 'frontend');
|
2023-03-14 05:13:21 -07:00
|
|
|
|
2022-10-25 04:46:25 -07:00
|
|
|
export default mergeConfig(
|
|
|
|
defineConfig({
|
2024-07-23 03:30:29 -07:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
icons({
|
|
|
|
compiler: 'vue3',
|
|
|
|
autoInstall: true,
|
|
|
|
}),
|
|
|
|
components({
|
|
|
|
dirs: [],
|
|
|
|
dts: false,
|
|
|
|
resolvers: [
|
|
|
|
iconsResolver({
|
2024-09-17 05:10:22 -07:00
|
|
|
prefix: 'icon',
|
|
|
|
}),
|
|
|
|
],
|
2024-07-23 03:30:29 -07:00
|
|
|
}),
|
|
|
|
],
|
2022-10-25 04:46:25 -07:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@': resolve(__dirname, 'src'),
|
2023-07-28 00:51:07 -07:00
|
|
|
'n8n-design-system': resolve(__dirname, 'src'),
|
2025-02-06 02:44:30 -08:00
|
|
|
'@n8n/composables(.*)': resolve(frontendDir, '@n8n', 'composables', 'src$1'),
|
2024-03-13 08:52:29 -07:00
|
|
|
lodash: 'lodash-es',
|
2022-10-25 04:46:25 -07:00
|
|
|
},
|
2022-04-29 06:23:41 -07:00
|
|
|
},
|
2022-10-25 04:46:25 -07:00
|
|
|
build: {
|
|
|
|
lib: {
|
2025-02-06 02:44:30 -08:00
|
|
|
entry: resolve(__dirname, 'src', 'index.ts'),
|
2022-10-25 04:46:25 -07:00
|
|
|
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',
|
|
|
|
},
|
2022-04-29 06:23:41 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-10-25 04:46:25 -07:00
|
|
|
}),
|
2023-11-07 05:19:39 -08:00
|
|
|
vitestConfig,
|
2022-10-25 04:46:25 -07:00
|
|
|
);
|