Description
🐛 Bug description
When creating a PR for #313, and is a bit of a blocker if we want to follow the .
semantic of how JS is usually output for libraries 😞 , I noticed that the --out-name
flag does not work properly if it contains a .
character. I assume this is also an issue with wasm-bindgen, but it would also affect what we do here.
I think this is better done by showing in examples. I'll use the node
target since it requires the _bg.js
shim, which also doesn't generate correctly.
Examples:
Happy Case:
Expected output
Case where name contains *.js
:
- Correctly ignores the .js extension when generating the main files.
- Missing shim
- wasm file is incorrectly names
- package json references non-existant files
Case where name contains *.somerandomextension
:
- Generated files ignore the extension
- Package.json references the correctly names files, but they were generated incorrectly
Case where name contains *.*.js
:
- Correctly ignores the .js extension when generating the main files.
- Missing shim
- wasm file is incorrectly names
- package json references non-existant files
🤔 Expected Behavior
Whenever there is a .
in the --out-name
, it should respect the additional extensions, and then build off of them. There probably is some discussion points of:
- How should the
_bg
be handled? - Should
.js
or.wasm
be ignored? - Do we only want to solve this on the wasm-bindgen layer, and then not allow the extensions on the
wasm-pack
layer?
👟 Steps to reproduce
Please see the examples screenshots 😄
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: current master
rustc version: 1.34.1
pop_OS! is a derivative of Ubuntu 😄
Thank you! 😄
cc @ashleygwilliams @alexcrichton @ibaryshnikov (since @ibaryshnikov opened #599 , and I see ya'll in the rust/wasm WG meetings 😄 )