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';
|
|
|
|
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'),
|
2023-07-28 00:51:07 -07:00
|
|
|
'n8n-design-system': resolve(__dirname, 'src'),
|
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: {
|
2023-04-06 06:32:45 -07:00
|
|
|
entry: resolve(__dirname, 'src', 'main.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
|
|
|
}),
|
|
|
|
defineVitestConfig({
|
|
|
|
test: {
|
|
|
|
globals: true,
|
|
|
|
environment: 'jsdom',
|
|
|
|
setupFiles: ['./src/__tests__/setup.ts'],
|
2023-03-14 05:13:21 -07:00
|
|
|
coverage: {
|
2023-07-28 04:55:16 -07:00
|
|
|
provider: 'v8',
|
2023-03-14 05:13:21 -07:00
|
|
|
reporter: coverageReporters,
|
|
|
|
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
|
|
|
}),
|
|
|
|
);
|