Skip to content

Commit

Permalink
Fix JS dependencies bundler's settings (widgets work in other noteboo…
Browse files Browse the repository at this point in the history
…k frontends) (#31)

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
  • Loading branch information
CBiasuzzi authored Oct 28, 2024
1 parent 7a8a77a commit 24483ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import esbuild from "esbuild";

esbuild.build({
entryPoints: ["js/*.ts", "js/*.jsx"],
bundle: true,
minify: true,
target: ["es2020"],
outdir: "src/pypowsybl_jupyter/static/",
format: "esm",
// Ref. https://github.com/powsybl/pypowsybl-jupyter/issues/30, https://github.com/manzt/anywidget/issues/506 and https://github.com/manzt/anywidget/issues/369#issuecomment-1792376003
define: {
"define.amd": "false",
},
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"dev": "npm run build -- --sourcemap=inline --watch",
"build": "esbuild js/*.ts js/*.jsx --minify --format=esm --bundle --outdir=src/pypowsybl_jupyter/static",
"build": "node ./esbuild.mjs",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext js,ts,jsx --max-warnings 0"
},
Expand Down

0 comments on commit 24483ab

Please sign in to comment.