This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Significant changes to clean things up and improve the user UX #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is a high-level list of all the changes:
Separates the rust-webpack-template files from the user files (user files are in the
templatefolder).This has a couple of benefits, the biggest is that the user no longer has a ton of unneeded files spewed into their project.
The other big benefit is that it lets us tailor things for the template: e.g. having a different
package.json, differentauthor, differentREADME, etc.I updated everything to be custom-tailored to the template (e.g. the README, name, author, dependencies, etc.)
It has a smoother "out of the box" experience: when using
npm starteverything is run in debug mode, andconsole_error_panic_hookis automatically enabled.Then when using
npm run buildit runs in release mode andconsole_error_panic_hookis automatically disabled.It now puts the
index.htmlfile into thestaticfolder, and usescopy-webpack-pluginto copy thestaticfolder into thedistfolder.What that means is that the user can now put any files they want into the
staticfolder and they will be copied as-is into thedistfolder when building. This can be very useful for including static resources like.cssfiles.It enables
ltowhen in release mode.The template now includes unit testing, so it's easy for the user to create unit tests. In addition there's now an
npm testcommand to run the tests.It now uses
wasm_bindgen(start)which is more idiomatic, and it also handles errors better when loading the.jsfile.The template directory now follows the standard Rust idioms (
Cargo.tomlandsrcat top level).It uses
rimrafto delete thedistandpkgfolders, ensuring that it doesn't contain any stale files.It now makes it a lot easier to enable
wee_allocif the user chooses to do so (it's still disabled by default).It does a shallow clone of the rust-webpack-template git, which makes the cloning a lot faster.
It's probably easiest to review the changes by looking at the entire repo, rather than the diffs.
After this is merged, the tutorial will need to be updated as well.
Fixes #27