rustwasm/rust-webpack-template

Crate in sub directory causes pkg to be created in the root.

Closed this issue · 1 comments

This may be intended behaviour and I'm missing something so apologies if that is the case.

When I nest my rust code in a subdirectory an run a build. A pkg directory is created in the root of my project with an empty index.js file in it. Everything else is working as expected, a pkg folder still gets created in my rust subdirectory and I can consume the index.js from there as expected.

Steps to Reproduce

  1. npm init rust-webpack my-app
  2. cd my-app && mkdir rust
  3. mv src tests Cargo.toml rust
  4. Update your webpack WasmPackPlugin crateDirectory to path.resolve(__dirname, 'rust')
  5. npm run build
  6. you will see that a pkg with an empty index.js file has been created in the root.

Expected Behavior

It shouldn't create the pkg folder in the root.

Closing as this is not the right place for this.
This is: wasm-tool/wasm-pack-plugin#87