Skip to content

Commit 238af05

Browse files
authored
[Blazor] Remove sourcemap link comments from production bundles for blazor.web.js and blazor.webassembly.js (#62558)
* Removes sourcemap link comments from production bundles for blazor.web.js and blazor.webassembly.js
1 parent 4ebbb4b commit 238af05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Components/Web.JS/rollup.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default createBaseConfig({
1313
'blazor.webview': './src/Boot.WebView.ts',
1414
},
1515
dir: __dirname,
16-
updateConfig: (config, environment, _, input) => {
16+
updateConfig: (config, environment, output, input) => {
1717
config.plugins.push({
1818
name: 'Resolve dotnet.js dynamic import',
1919
resolveDynamicImport(source, importer) {
@@ -26,6 +26,9 @@ export default createBaseConfig({
2626

2727
if (input.includes("WebView")) {
2828
config.output.sourcemap = 'inline';
29+
} else if (environment === 'production' && (output === 'blazor.web' || output === 'blazor.webassembly')) {
30+
// Generate sourcemaps but don't emit sourcemap link comments for production bundles
31+
config.output.sourcemap = 'hidden';
2932
} else {
3033
config.output.sourcemap = true;
3134
}

0 commit comments

Comments
 (0)