We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c7a206 commit 51549c4Copy full SHA for 51549c4
plugin/vite.config.mts
@@ -30,6 +30,11 @@ function getBuildStamp(): string {
30
return `v${version}-${commitSha}-${timestamp}`;
31
}
32
33
+function getShouldMinify(): boolean {
34
+ const env = loadEnv("prod", process.cwd());
35
+ return env?.VITE_ENV !== "dev";
36
+}
37
+
38
export default defineConfig({
39
plugins: [
40
react(),
@@ -50,6 +55,7 @@ export default defineConfig({
50
55
build: {
51
56
// We aren't building a website, so we build in library mode
52
57
// and bundle the output using our index.ts as the entrypoint.
58
+ minify: getShouldMinify(),
53
59
lib: {
54
60
entry: resolve(__dirname, "src/index.ts"),
61
fileName: "main",
0 commit comments