Skip to content

Support targeting Node #266

Closed
Closed
@nikgraf

Description

@nikgraf

💡 Feature description

I was trying @xtuc's wasm-node-loader, but noticed the output of wasm-pack is not compatible to Node 10.

Three things I noticed:

  • the file ending of the generated JS file is .js, but node will require a .mjs ending.
  • import of the wasm file not ending with .wasm. e.g. import * as wasm from './app_bg'; . With the node loader it should be import * as wasm from './app_bg.wasm.
  • after I changed them manually node was still complaining it can't fine "./app.js", but not sure where this was coming from.

I'm not sure what's the best way forward. wasm-pack could support a commnand line flag for wasm-pack build to target node. On the other hand maybe it needs a different node loader.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions