2024-03-31 00:47:47 +00:00
|
|
|
import { defineConfig } from 'vite';
|
2024-06-13 22:44:23 +00: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 17:46:30 +00:00
|
|
|
trace: true,
|
2024-06-07 22:33:45 +00: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 22:44:23 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"#enums": path.resolve('./src/enums')
|
|
|
|
}
|
|
|
|
},
|
2024-03-31 00:47:47 +00:00
|
|
|
esbuild: {
|
|
|
|
pure: mode === 'production' ? [ 'console.log' ] : [],
|
|
|
|
keepNames: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|