Skip to content

Conversation

@kurikomoe
Copy link

Fix the problem when outDir is a relative path, wasm-pack will use
Cargo.toml as root path, but this._makeEmpty will use package.json

for example

webpack.config.js:

    new WasmPackPlugin({
      crateDirectory: path.resolve(__dirname, "./src/native"),
      outDir: "./source/pkg",
    }),

without the patch, extra index.js will be generated.

./source/pkg/index.js (empty file)
./src/native/source/pkg/xxxx (actual files)

Fix the problem when outDir is a relative path, wasm-pack will use
Cargo.toml as root path, but this._makeEmpty will use package.json
@serprex
Copy link

serprex commented Nov 15, 2020

drager/wasm-pack#712

It's actually a bug that wasm-pack isn't putting pkg where outDir expects it to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants