Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(pkg output): Fix the pkg output path #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

rustwasm/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