n8n/packages/design-system/vite.config.ts
कारतोफ्फेलस्क्रिप्ट™ 7461085408
ci: Update most of the dev tooling (no-changelog) (#6780)
2023-07-28 13:55:16 +02:00

56 lines
1.2 KiB
TypeScript

import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';
import { defineConfig as defineVitestConfig } from 'vitest/config';
const { coverageReporters } = require('../../jest.config.js');
export default mergeConfig(
defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'n8n-design-system': resolve(__dirname, 'src'),
},
},
build: {
lib: {
entry: resolve(__dirname, 'src', 'main.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',
},
},
},
},
}),
defineVitestConfig({
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
coverage: {
provider: 'v8',
reporter: coverageReporters,
all: true,
},
css: {
modules: {
classNameStrategy: 'non-scoped',
},
},
},
}),
);