fix/update vite.config.ts (#3531)
- fix types - update defintion to map `UserConfig` type
This commit is contained in:
parent
bcca218777
commit
b7d7d9bcf3
|
@ -1,27 +1,27 @@
|
|||
import { defineConfig, loadEnv } from 'vite';
|
||||
import { defineConfig, loadEnv, Rollup, UserConfig } from 'vite';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
import { minifyJsonPlugin } from "./src/plugins/vite/vite-minify-json-plugin";
|
||||
|
||||
export const defaultConfig = {
|
||||
export const defaultConfig: UserConfig = {
|
||||
plugins: [
|
||||
tsconfigPaths() as any,
|
||||
tsconfigPaths(),
|
||||
minifyJsonPlugin(["images", "battle-anims"], true)
|
||||
],
|
||||
clearScreen: false,
|
||||
appType: "mpa",
|
||||
build: {
|
||||
minify: 'esbuild' as const,
|
||||
minify: 'esbuild',
|
||||
sourcemap: false,
|
||||
},
|
||||
rollupOptions: {
|
||||
onwarn(warning, warn) {
|
||||
onwarn(warning: Rollup.RollupLog, defaultHandler: (warning: string | Rollup.RollupLog) => void) {
|
||||
// Suppress "Module level directives cause errors when bundled" warnings
|
||||
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
||||
return;
|
||||
}
|
||||
warn(warning);
|
||||
defaultHandler(warning);
|
||||
},
|
||||
},
|
||||
},
|
||||
appType: "mpa",
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue