Skip to content

Commit

Permalink
Keep webpackIgnore comments in pyodide.js (#4294)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ryanking13 and pre-commit-ci[bot] committed Nov 17, 2023
1 parent fd270dd commit 8dc568f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ __pycache__
.pytest_cache/
.vscode
.venv*
tsconfig.tsbuildinfo

build
ccache
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ node_modules/.installed : src/js/package.json src/js/package-lock.json
touch node_modules/.installed

dist/pyodide.js src/js/generated/_pyodide.out.js: src/js/*.ts src/js/generated/pyproxy.ts node_modules/.installed
cd src/js && npm run tsc && node esbuild.config.mjs && cd -
cd src/js && npm run build && cd -

src/core/stack_switching/stack_switching.out.js : src/core/stack_switching/*.mjs
node src/core/stack_switching/esbuild.config.mjs
Expand Down
3 changes: 3 additions & 0 deletions docs/project/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ myst:
- {{ Fix }} Fixed default indexURL calculation in Node.js environment.
{pr}`4288`

- {{ Fix }} Fixed a bug that webpack messes up dynamic import of `pyodide.asm.js`.
{pr}`4294`

- {{ Enhancement }} Added experimental support for stack switching.
{pr}`3957`, {pr}`3964`, {pr}`3987`, {pr}`3990`, {pr}`3210`

Expand Down
3 changes: 3 additions & 0 deletions src/js/esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ try {
`try{Object.assign(exports,${name})}catch(_){}\nglobalThis.${name}=${name}.${name};\n//# sourceMappingURL`,
);

// inject webpackIgnore comments
content = content.replaceAll("import(", "import(/* webpackIgnore */");

writeFileSync(outfile, content);
}
} catch ({ message }) {
Expand Down
1 change: 1 addition & 0 deletions src/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"ws": false
},
"scripts": {
"build": "tsc --noEmit && node esbuild.config.mjs",
"test": "npm-run-all test:*",
"test:unit": "cross-env TEST_NODE=1 ts-mocha --node-option=experimental-loader=./test/loader.mjs --node-option=experimental-wasm-stack-switching -p tsconfig.test.json test/unit/**/*.test.*",
"test:node": "cross-env TEST_NODE=1 mocha test/integration/**/*.test.js",
Expand Down
1 change: 1 addition & 0 deletions src/js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"module": "ES2022",
"moduleResolution": "node",
"composite": true,
"tsBuildInfoFile": "tsconfig.tsbuildinfo",
"strict": true,
"noUnusedLocals": false,
"types": ["node"],
Expand Down

0 comments on commit 8dc568f

Please sign in to comment.