Skip to content

Commit 3773508

Browse files
authored
Use rsbuild inline sourcemaps for JupyterLab extension (#909)
1 parent 2566887 commit 3773508

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.changeset/khaki-houses-poke.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"anywidget": patch
3+
---
4+
5+
Use rsbuild inline sourcemaps for JupyterLab extension
6+
7+
JupyterLab was refusing to load external source map files because they were
8+
being served with the wrong MIME type ('application/octet-stream' instead of
9+
the expected source map MIME type). This caused the extension to fail loading
10+
in version 0.9.20.
11+
12+
Switching to inline source maps embeds the source map directly in the
13+
JavaScript bundle, avoiding the MIME type issue while still providing source
14+
map support for debugging.

packages/anywidget/scripts/jlab.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fs.rmSync(out, { recursive: true, force: true });
1212
module.exports = {
1313
mode: "production",
1414
optimization: { minimize: false },
15-
devtool: "source-map",
15+
devtool: "inline-source-map",
1616
entry: path.resolve(root, "src/index.js"),
1717
output: {
1818
filename: "[name].[contenthash:8].js",

0 commit comments

Comments
 (0)