import { defineConfig } from 'vite'; import { fileURLToPath } from 'node:url'; import { configDefaults } from 'vitest/config'; export default defineConfig({ optimizeDeps: { exclude: ['vue-demi'], }, build: { sourcemap: true, minify: false, target: 'esnext', rollupOptions: { external: [ 'vue', /^@dialpad/, /^node/, /^fs/, /^path/, /^os/, /^stream/, 'events', 'util', 'fluent-vue', ], output: { preserveModules: false, minifyInternalExports: false, exports: 'named', }, treeshake: 'smallest', }, lib: { entry: { dialpadistan: fileURLToPath( new URL('src/dialpadistan/index.ts', import.meta.url), ), 'translation-service/pull': fileURLToPath( new URL('src/translation-service/pull/index.ts', import.meta.url), ), 'translation-service/should-pull': fileURLToPath( new URL( 'src/translation-service/pull/should-pull.ts', import.meta.url, ), ), 'translation-service/force-pull': fileURLToPath( new URL( 'src/translation-service/pull/force-pull.ts', import.meta.url, ), ), 'translation-service/push': fileURLToPath( new URL('src/translation-service/push/index.ts', import.meta.url), ), 'translation-service/screenshots-check': fileURLToPath( new URL( 'src/translation-service/screenshots-check/index.ts', import.meta.url, ), ), 'bundle-source/index': fileURLToPath( new URL('src/bundle-source/index.ts', import.meta.url), ), 'storage/index': fileURLToPath( new URL('src/storage/index.ts', import.meta.url), ), 'locale-manager/base-locale-manager': fileURLToPath( new URL('src/locale-manager/base-locale-manager.ts', import.meta.url), ), }, formats: ['es'], }, }, plugins: [], test: { // Add test runner globals like test/it/describe/afterEach etc. // This is required for VTL to automically call cleanup() in afterEach(). // See: https://vitest.dev/guide/migration.html globals: true, environment: 'jsdom', coverage: { reporter: ['html', 'json'], }, exclude: [...configDefaults.exclude], }, resolve: { alias: { '@': fileURLToPath(new URL('src', import.meta.url)), }, }, });