mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-12-11 08:07:15 +00:00
589801214b
* make vite-port configurable and make it default 8000 * add retries for `does not trigger by non damage moves` test
37 lines
768 B
TypeScript
37 lines
768 B
TypeScript
import { defineConfig, loadEnv } from 'vite';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
export const defaultConfig = {
|
|
plugins: [tsconfigPaths() as any],
|
|
clearScreen: false,
|
|
build: {
|
|
minify: 'esbuild' as const,
|
|
sourcemap: false,
|
|
},
|
|
rollupOptions: {
|
|
onwarn(warning, warn) {
|
|
// Suppress "Module level directives cause errors when bundled" warnings
|
|
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
|
return;
|
|
}
|
|
warn(warning);
|
|
},
|
|
}
|
|
};
|
|
|
|
|
|
export default defineConfig(({mode}) => {
|
|
const envPort = Number(loadEnv(mode, process.cwd()).VITE_PORT);
|
|
|
|
return ({
|
|
...defaultConfig,
|
|
esbuild: {
|
|
pure: mode === 'production' ? ['console.log'] : [],
|
|
keepNames: true,
|
|
},
|
|
server: {
|
|
port: !isNaN(envPort) ? envPort : 8000,
|
|
}
|
|
});
|
|
});
|