From b7d7d9bcf3610127ebafebde43594229d43b2394 Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Tue, 13 Aug 2024 23:24:49 +0200 Subject: [PATCH] fix/update vite.config.ts (#3531) - fix types - update defintion to map `UserConfig` type --- vite.config.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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", };