2024-03-31 00:47:47 +00:00
|
|
|
import { defineConfig } from 'vite';
|
2024-06-13 23:44:23 +01:00
|
|
|
import path from 'path';
|
2024-03-31 00:47:47 +00:00
|
|
|
// import fs from 'vite-plugin-fs';
|
|
|
|
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
return {
|
|
|
|
test: {
|
|
|
|
setupFiles: ['./src/test/vitest.setup.ts'],
|
|
|
|
environment: 'jsdom',
|
|
|
|
deps: {
|
|
|
|
optimizer: {
|
|
|
|
web: {
|
|
|
|
include: ['vitest-canvas-mock'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
threads: false,
|
2024-05-24 18:46:30 +01:00
|
|
|
trace: true,
|
2024-06-07 23:33:45 +01:00
|
|
|
restoreMocks: true,
|
2024-03-31 00:47:47 +00:00
|
|
|
environmentOptions: {
|
|
|
|
jsdom: {
|
|
|
|
resources: 'usable',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
coverage: {
|
|
|
|
provider: 'istanbul',
|
|
|
|
reportsDirectory: 'coverage',
|
|
|
|
reporters: ['text-summary', 'html'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [/*fs()*/],
|
|
|
|
server: { host: '0.0.0.0', port: 8000 },
|
|
|
|
clearScreen: false,
|
|
|
|
build: {
|
|
|
|
minify: 'esbuild',
|
|
|
|
sourcemap: true
|
|
|
|
},
|
2024-06-13 23:44:23 +01:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"#enums": path.resolve('./src/enums')
|
|
|
|
}
|
|
|
|
},
|
2024-03-31 00:47:47 +00:00
|
|
|
esbuild: {
|
|
|
|
pure: mode === 'production' ? [ 'console.log' ] : [],
|
|
|
|
keepNames: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|