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 tsconfigPaths from 'vite-tsconfig-paths';
|
||||||
import { minifyJsonPlugin } from "./src/plugins/vite/vite-minify-json-plugin";
|
import { minifyJsonPlugin } from "./src/plugins/vite/vite-minify-json-plugin";
|
||||||
|
|
||||||
export const defaultConfig = {
|
export const defaultConfig: UserConfig = {
|
||||||
plugins: [
|
plugins: [
|
||||||
tsconfigPaths() as any,
|
tsconfigPaths(),
|
||||||
minifyJsonPlugin(["images", "battle-anims"], true)
|
minifyJsonPlugin(["images", "battle-anims"], true)
|
||||||
],
|
],
|
||||||
clearScreen: false,
|
clearScreen: false,
|
||||||
|
appType: "mpa",
|
||||||
build: {
|
build: {
|
||||||
minify: 'esbuild' as const,
|
minify: 'esbuild',
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
},
|
rollupOptions: {
|
||||||
rollupOptions: {
|
onwarn(warning: Rollup.RollupLog, defaultHandler: (warning: string | Rollup.RollupLog) => void) {
|
||||||
onwarn(warning, warn) {
|
// Suppress "Module level directives cause errors when bundled" warnings
|
||||||
// Suppress "Module level directives cause errors when bundled" warnings
|
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
||||||
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
defaultHandler(warning);
|
||||||
warn(warning);
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
appType: "mpa",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue