FIX for webpack: Export binary files in javascript package (#3085)

This adds the distributed binary files to the "exports" section of the package.json file. 
This allows the files to be referenced, e.g. by `require.resolve('pyodide/distutils.tar')`
which is useful for tools like webpack.
This commit is contained in:
David Lechner 2022-09-11 14:11:59 -05:00 committed by GitHub
parent 4dd8a3e0cb
commit 39522cd83a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,9 @@ substitutions:
`indexURL` (this was a regression in v0.21.2).
{pr}`3077`
- {{ Enhancement }} Add binary files to exports in JavaScript package
{pr}`3085`.
- {{ Enhancement }} Pyodide now works with a content security policy that
doesn't include `unsafe-eval`. It is still necessary to include
`wasm-unsafe-eval` (and probably always will be). Since current Safari

View File

@ -51,6 +51,11 @@
"require": "./pyodide.js",
"import": "./pyodide.mjs"
},
"./distutils.tar": "./distutils.tar",
"./pyodide.asm.wasm": "./pyodide.asm.wasm",
"./pyodide.asm.js": "./pyodide.asm.js",
"./pyodide.asm.data": "./pyodide.asm.data",
"./pyodide_py.tar": "./pyodide_py.tar",
"./pyodide.mjs": "./pyodide.mjs",
"./pyodide.js": "./pyodide.js",
"./package.json": "./package.json",