n8n/packages/design-system/vite.config.ts
Iván Ovejero adef6d7083
fix(editor): upgrade and make testing consistent in editor-ui and design-system (#4434)
* 📦 Update `package-lock.json`

* 📦 Make versions consistent in design-system

* 📦 Make lib versions consistent in editor-ui

* 🔧 Make vite configs consistent

* fix(design-system): updating vue2-bring-avatars alias

Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
2022-10-25 13:46:25 +02:00

46 lines
1,019 B
TypeScript

import vue from '@vitejs/plugin-vue2';
import { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';
import { defineConfig as defineVitestConfig } from 'vitest/config';
export default mergeConfig(
defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'vue2-boring-avatars': require.resolve('vue2-boring-avatars'),
},
},
build: {
lib: {
entry: resolve(__dirname, 'src', 'main.js'),
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',
},
},
},
},
}),
defineVitestConfig({
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
},
}),
);