Skip to content

Commit 0ff1837

Browse files
[ci] allow setting GENERATE_SOURCEMAP as env var (#6134)
## Summary Introduces a `GENERATE_SOURCEMAP` environment flag in `vite.config.mts` that defaults to enabled (`true` unless set to `'false'`). This keeps source maps on by default, while allowing opt-out for lean production artifacts. Allows the choice to be made as part of the distribution pipeline and changed for different targets. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6134-ci-allow-setting-GENERATE_SOURCEMAP-as-env-var-2916d73d3650815d91b9eff12b6e55fd) by [Unito](https://www.unito.io)
1 parent 7e1e8e3 commit 0ff1837

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vite.config.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const ANALYZE_BUNDLE = process.env.ANALYZE_BUNDLE === 'true'
2222
const VITE_REMOTE_DEV = process.env.VITE_REMOTE_DEV === 'true'
2323
const DISABLE_TEMPLATES_PROXY = process.env.DISABLE_TEMPLATES_PROXY === 'true'
2424
const DISABLE_VUE_PLUGINS = process.env.DISABLE_VUE_PLUGINS === 'true'
25+
const GENERATE_SOURCEMAP = process.env.GENERATE_SOURCEMAP !== 'false'
2526

2627
const DEV_SERVER_COMFYUI_URL =
2728
process.env.DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188'
@@ -185,7 +186,7 @@ export default defineConfig({
185186
build: {
186187
minify: SHOULD_MINIFY ? 'esbuild' : false,
187188
target: 'es2022',
188-
sourcemap: true,
189+
sourcemap: GENERATE_SOURCEMAP,
189190
rollupOptions: {
190191
treeshake: true
191192
}

0 commit comments

Comments
 (0)