pokerogue/vite.config.ts
Sirz Benjie 6766940fa1
[Misc] Make the repo REUSE compliant (#6474)
* Add license information

* Add reuse lint workflow

* Add snippets for spdx

* fix: minor wording adjustments and typo fixes

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* chore: add FileContributor attributions for Bertie

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* begin licensing some audio assets

* Add pokemon reborn sound affect attribution

* Annotate Leavannite's section

* Add more licensing info

* Add license info to license files ._.

* Move ps1 files out of public

* Add license for animation jsons

* Add license for bat scripts in public

* Update licensing in scripts

* Fix typo in license ref

* Fix AGPL-3.0-or-later

* Add license info to typedoc.config.js

* Add MIT license for snippets

* chore: update license info for files in scripts

* chore: update license info

* chore: update license info

* chore: update license info

* Remove licenses used only by public before linting with reuse

* Add license info to new files added by docker PR

* chore: apply biome

* fix: add back linting workflow lost during merge

* Add attribution based on Hanniel's information

* Add attribution based on Officer Porkchop and Green Ninja's information

* add attribution to unicorn_power for reshiram/zekrom/kyurem epic variant

* Fixup minor typo

* Adjust sprite test to not think REUSE.toml is a sprite json

* Add missing continue-on-error to workflow

* fix: address kev's comments from code review

* docs: minor touchups

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-09-23 08:49:03 -05:00

46 lines
1.2 KiB
TypeScript

/*
* SPDX-FileCopyrightText: 2024-2025 Pagefault Games
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { defineConfig, loadEnv, type Rollup, type UserConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { minifyJsonPlugin } from "./src/plugins/vite/vite-minify-json-plugin";
export const defaultConfig: UserConfig = {
plugins: [tsconfigPaths(), minifyJsonPlugin(["images", "battle-anims"], true)],
clearScreen: false,
appType: "mpa",
build: {
chunkSizeWarningLimit: 10000,
minify: "esbuild",
sourcemap: false,
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);
},
},
},
};
export default defineConfig(({ mode }) => {
const envPort = Number(loadEnv(mode, process.cwd()).VITE_PORT);
return {
...defaultConfig,
base: "",
esbuild: {
pure: mode === "production" ? ["console.log"] : [],
keepNames: true,
},
server: {
port: !Number.isNaN(envPort) ? envPort : 8000,
},
};
});