You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and 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.
Expected Behavior
It shouldn't create the pkg folder in the root.
The text was updated successfully, but these errors were encountered:
I'm having the same issue. Just spent like half an hour digging through all my various build configurations trying to figure out where that pkg folder in the root with the empty index.js was coming from.
It's not a matter of finding the right outDir. That works. It creates a pkg where it's supposed to, with all the right files. It just ALSO creates a SECOND pkg folder in the root of the project.
It's hardly a catastrophic bug, but it's definitely causing some confusion. Also, specifying outDir explicitly does cause the bug to go away. That's my workaround for now, I guess.
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 and 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 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
WasmPackPlugin
crateDirectory
topath.resolve(__dirname, 'rust')
npm run build
Expected Behavior
It shouldn't create the pkg folder in the root.
The text was updated successfully, but these errors were encountered: