Skip to content

Commit 51549c4

Browse files
committed
vite.config: turn off minification for local dev
1 parent 3c7a206 commit 51549c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugin/vite.config.mts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ function getBuildStamp(): string {
3030
return `v${version}-${commitSha}-${timestamp}`;
3131
}
3232

33+
function getShouldMinify(): boolean {
34+
const env = loadEnv("prod", process.cwd());
35+
return env?.VITE_ENV !== "dev";
36+
}
37+
3338
export default defineConfig({
3439
plugins: [
3540
react(),
@@ -50,6 +55,7 @@ export default defineConfig({
5055
build: {
5156
// We aren't building a website, so we build in library mode
5257
// and bundle the output using our index.ts as the entrypoint.
58+
minify: getShouldMinify(),
5359
lib: {
5460
entry: resolve(__dirname, "src/index.ts"),
5561
fileName: "main",

0 commit comments

Comments
 (0)