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
npm init rust-webpack my-app
cd my-app && mkdir rust
mv src tests Cargo.toml rust
Update your webpack WasmPackPlugincrateDirectory to path.resolve(__dirname, 'rust')
npm run build
you will see that a pkg with an empty index.js file has been created in the root.
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 emptyindex.js
file in it. Everything else is working as expected, apkg
folder still gets created in my rust subdirectory and I can consume theindex.js
from there as expected.Steps to Reproduce
npm init rust-webpack my-app
cd my-app && mkdir rust
mv src tests Cargo.toml rust
WasmPackPlugin
crateDirectory
topath.resolve(__dirname, 'rust')
npm run build
pkg
with an emptyindex.js
file has been created in the root.Expected Behavior
It shouldn't create the
pkg
folder in the root.