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

npm run start compiles crate in "dev" profile by default #116

Open
bantic opened this issue Mar 4, 2019 · 3 comments
Open

npm run start compiles crate in "dev" profile by default #116

bantic opened this issue Mar 4, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@bantic
Copy link
Contributor

bantic commented Mar 4, 2019

Describe the Bug

npm run start uses the WasmPackPlugin to compile the associated crate, and that plugin compiles in "dev" profile by default.
This wasn't obvious (to me), and it seems that it contravenes other documentation in the wasm-pack book that indicates that wasm-pack build defaults to "release" profile.

As a result, I found it very confusing when profiling the (slow vs js) performance of a fairly simple wasm module that I had built and was running from this template.

Steps to Reproduce

  1. npm init rust-webpack my-app
  2. cd my-app
  3. npm run start
  4. Crate is compiled in dev profile, but there is no indication in the README, webpack.config.js, or the terminal that this is so.

Expected Behavior

I was expecting that the crate would be compiled in "release" profile, since the wasm-pack documentation says that that is its default.

Actual Behavior

The crate is is compiled in "dev" profile.

@bantic bantic added the bug Something isn't working label Mar 4, 2019
@bantic
Copy link
Contributor Author

bantic commented Mar 4, 2019

I made a PR (#117) to add some info to the webpack config that would have helped me.
If it would be useful, I'd be happy to make a follow-up PR to modify the README to point this out, or take a stab at modifying the command-line output to add "in X profile" to the Compiling your crate... message.

@xtuc
Copy link
Member

xtuc commented Mar 4, 2019

It would be great if you can change the compilation message to indicate the env, 👍

You can find it here https://github.com/wasm-tool/wasm-pack-plugin/blob/b26fc434ef8c87b7807a0ddd68fae962c0b37ae0/plugin.js#L70

@bantic
Copy link
Contributor Author

bantic commented Mar 6, 2019

@xtuc Thanks! Added a PR for the wasm-pack-plugin: wasm-tool/wasm-pack-plugin#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants