diff --git a/vite.config.ts b/vite.config.ts index 4bd013bff2e..8fa7d799f27 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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) { - // Suppress "Module level directives cause errors when bundled" warnings - if (warning.code === "MODULE_LEVEL_DIRECTIVE") { - return; - } - warn(warning); + rollupOptions: { + 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; + } + defaultHandler(warning); + }, }, }, - appType: "mpa", };