Skip to content

Commit 9dcc7e5

Browse files
Copilotjaviercn
andcommitted
Fix sourcemap link comments in production bundles for blazor.web.js and blazor.webassembly.js
Co-authored-by: javiercn <[email protected]>
1 parent d27f7e4 commit 9dcc7e5

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@babel/core": "^7.23.6",
2424
"@babel/preset-env": "^7.23.6",
2525
"@babel/preset-typescript": "^7.23.3",
26-
"@microsoft/dotnet-js-interop": "*",
26+
"@microsoft/dotnet-js-interop": "^10.0.0-dev",
2727
"@microsoft/dotnet-runtime": "*",
2828
"@microsoft/signalr": "*",
2929
"@microsoft/signalr-protocol-msgpack": "*",

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)