Skip to content

Commit

Permalink
fix: browser field in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jan 10, 2024
1 parent 70bb567 commit a3c5e2d
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 27 deletions.
1 change: 1 addition & 0 deletions browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@napi-rs/package-template-pnpm-wasm32-wasi'
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "1.1.0",
"description": "Template project for writing node package with napi-rs",
"main": "index.js",
"types": "index.d.ts",
"browser": "browser.js",
"repository": {
"url": "git+ssh://git@github.com/napi-rs/package-template-pnpm.git",
"type": "git"
Expand All @@ -18,7 +20,8 @@
],
"files": [
"index.d.ts",
"index.js"
"index.js",
"browser.js"
],
"napi": {
"binaryName": "package-template",
Expand Down Expand Up @@ -63,7 +66,7 @@
"devDependencies": {
"@emnapi/core": "^0.45.0",
"@emnapi/runtime": "^0.45.0",
"@napi-rs/cli": "^3.0.0-alpha.33",
"@napi-rs/cli": "^3.0.0-alpha.34",
"@swc-node/register": "^1.6.8",
"@swc/core": "^1.3.102",
"@taplo/cli": "^0.5.2",
Expand All @@ -79,7 +82,7 @@
"eslint-plugin-import": "^2.29.1",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"memfs-browser": "^3.4.13000",
"memfs-browser": "^4.6.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",
"typescript": "^5.3.3"
Expand Down
98 changes: 74 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions wasi-worker-browser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const handler = new MessageHandler({
// eslint-disable-next-line no-console
console.log.apply(console, arguments)
},
printErr: function() {
// eslint-disable-next-line no-console
console.error.apply(console, arguments)
},
})
return instantiateNapiModuleSync(wasmModule, {
childThread: true,
Expand Down

0 comments on commit a3c5e2d

Please sign in to comment.