2024-06-13 23:44:23 +01:00
|
|
|
import { resolve } from 'path';
|
2023-04-04 01:47:41 +01:00
|
|
|
import { defineConfig } from 'vite';
|
2024-06-13 23:44:23 +01:00
|
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
2024-03-26 00:02:54 +00:00
|
|
|
// import fs from 'vite-plugin-fs';
|
2023-03-28 19:54:52 +01:00
|
|
|
|
2024-03-28 15:48:51 +00:00
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
return {
|
2024-06-13 23:44:23 +01:00
|
|
|
plugins: [tsconfigPaths()],
|
2024-03-28 15:48:51 +00:00
|
|
|
server: { host: '0.0.0.0', port: 8000 },
|
|
|
|
clearScreen: false,
|
|
|
|
build: {
|
|
|
|
minify: 'esbuild',
|
2024-06-13 23:44:23 +01:00
|
|
|
sourcemap: false,
|
|
|
|
},
|
|
|
|
rollupOptions: {
|
|
|
|
onwarn(warning, warn) {
|
|
|
|
// Suppress "Module level directives cause errors when bundled" warnings
|
|
|
|
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
warn(warning);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"#enums": resolve('./src/enums')
|
|
|
|
}
|
2024-03-28 15:48:51 +00:00
|
|
|
},
|
|
|
|
esbuild: {
|
|
|
|
pure: mode === 'production' ? [ 'console.log' ] : [],
|
|
|
|
keepNames: true,
|
2024-03-31 00:47:47 +00:00
|
|
|
},
|
2024-03-26 00:02:54 +00:00
|
|
|
}
|
2023-03-28 19:54:52 +01:00
|
|
|
})
|