2022-10-25 04:46:25 -07:00
|
|
|
import vue from '@vitejs/plugin-vue2';
|
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';
|
|
|
|
import { defineConfig as defineVitestConfig } from 'vitest/config';
|
2022-04-29 06:23:41 -07:00
|
|
|
|
2023-03-14 05:13:21 -07:00
|
|
|
const { coverageReporters } = require('../../jest.config.js');
|
|
|
|
|
2022-10-25 04:46:25 -07:00
|
|
|
export default mergeConfig(
|
|
|
|
defineConfig({
|
2022-11-15 09:20:54 -08:00
|
|
|
plugins: [vue()],
|
2022-10-25 04:46:25 -07:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@': resolve(__dirname, 'src'),
|
|
|
|
'vue2-boring-avatars': require.resolve('vue2-boring-avatars'),
|
|
|
|
},
|
2022-04-29 06:23:41 -07:00
|
|
|
},
|
2022-10-25 04:46:25 -07:00
|
|
|
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',
|
|
|
|
},
|
2022-04-29 06:23:41 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-10-25 04:46:25 -07:00
|
|
|
}),
|
|
|
|
defineVitestConfig({
|
|
|
|
test: {
|
|
|
|
globals: true,
|
|
|
|
environment: 'jsdom',
|
|
|
|
setupFiles: ['./src/__tests__/setup.ts'],
|
2023-03-14 05:13:21 -07:00
|
|
|
coverage: {
|
|
|
|
provider: 'c8',
|
|
|
|
reporter: coverageReporters,
|
|
|
|
include: ['src/**/*.ts'],
|
|
|
|
all: true,
|
|
|
|
},
|
2023-01-26 17:09:30 -08:00
|
|
|
css: {
|
|
|
|
modules: {
|
|
|
|
classNameStrategy: 'non-scoped',
|
|
|
|
},
|
2023-01-16 05:16:12 -08:00
|
|
|
},
|
|
|
|
},
|
2022-10-25 04:46:25 -07:00
|
|
|
}),
|
|
|
|
);
|