{"action":"closed","issue":{"url":"https://api.github.com/repos/rustwasm/deprecated_rust_wasm_template/issues/6","repository_url":"https://api.github.com/repos/rustwasm/deprecated_rust_wasm_template","labels_url":"https://api.github.com/repos/rustwasm/deprecated_rust_wasm_template/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/rustwasm/deprecated_rust_wasm_template/issues/6/comments","events_url":"https://api.github.com/repos/rustwasm/deprecated_rust_wasm_template/issues/6/events","html_url":"https://github.com/rustwasm/deprecated_rust_wasm_template/issues/6","id":329150536,"node_id":"MDU6SXNzdWUzMjkxNTA1MzY=","number":6,"title":"Pre-configure multiple different builds","user":{"login":"fitzgen","id":74571,"node_id":"MDQ6VXNlcjc0NTcx","avatar_url":"https://avatars2.githubusercontent.com/u/74571?v=4","gravatar_id":"","url":"https://api.github.com/users/fitzgen","html_url":"https://github.com/fitzgen","followers_url":"https://api.github.com/users/fitzgen/followers","following_url":"https://api.github.com/users/fitzgen/following{/other_user}","gists_url":"https://api.github.com/users/fitzgen/gists{/gist_id}","starred_url":"https://api.github.com/users/fitzgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fitzgen/subscriptions","organizations_url":"https://api.github.com/users/fitzgen/orgs","repos_url":"https://api.github.com/users/fitzgen/repos","events_url":"https://api.github.com/users/fitzgen/events{/privacy}","received_events_url":"https://api.github.com/users/fitzgen/received_events","type":"User","site_admin":false},"labels":[{"id":941485720,"node_id":"MDU6TGFiZWw5NDE0ODU3MjA=","url":"https://api.github.com/repos/rustwasm/deprecated_rust_wasm_template/labels/enhancement","name":"enhancement","color":"a2eeef","default":true},{"id":941485721,"node_id":"MDU6TGFiZWw5NDE0ODU3MjE=","url":"https://api.github.com/repos/rustwasm/deprecated_rust_wasm_template/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-06-04T17:35:50Z","updated_at":"2018-07-30T20:46:04Z","closed_at":"2018-07-30T20:46:04Z","author_association":"MEMBER","body":"We should have a couple build pipelines/configurations from invoking `cargo` through serving locally with `webpack-dev-server`. I'm hazy on exactly how the webpack integration will look, but here are the three configurations I have typically had in wasm projects, and think we should support coming pre-configured out of the box in this template:\r\n\r\n1. **debug**: Without optimizations and with debug info. This is fastest to build and has debug info. It is appropriate for development, testing, and debugging. Note, there is no need to run `wasm-opt` for this configuration. This is essentially:\r\n\r\n  ```\r\n  cargo build --target wasm32-unknown-unknown\r\n  wasm-bindgen ...\r\n  ``` \r\n\r\n2. **profiling**: A build with optimizations *and* debug info. This is slower to build than **debug**. It is appropriate for time profiling. This should enable LTO and run `wasm-opt` with the `-g` flag. This is essentially:\r\n\r\n  ```\r\n  cargo rustc -- -C debuginfo=2 -C opt-level=s -C lto=fat --target wasm32-unknown-unknown\r\n  wasm-bindgen ...\r\n  wasm-opt -g -Oz ...\r\n  ```\r\n\r\n3. **production**: A build with optimizations and without debug info in the final `wasm` artifact and snipping away debugging related code. Note that `wasm-snip` requires debug info, but we don't pass the `-g` flag to `wasm-opt` which causes the debug info to be removed from its output. This produces the smallest, fastest `wasm` binary.\r\n\r\n  ```\r\n  cargo rustc -- -C debuginfo=2 -C opt-level=s -C lto=fat --target wasm32-unknown-unknown\r\n  wasm-bindgen ...\r\n  wasm-snip --snip-rust-panicking-code --snip-rust-fmt-code ...\r\n  wasm-opt -Oz ...\r\n  ```\r\n\r\ncc @sendilkumarn @xtuc since I expect a lot of this to end up as options to `rust-plugin`,"}}
{"actor":{"display_login":"fitzgen"}}