An npm init
template for kick starting a project that uses NPM packages containing Rust-generated WebAssembly and bundles them with Webpack.
Built with 🦀🕸 by The Rust and WebAssembly Working Group
This template is designed for depending on NPM packages that contain Rust-generated WebAssembly and using them to create a Website.
- Want to create an NPM package with Rust and WebAssembly? Check out
wasm-pack-template
. - Want to make a monorepo-style Website without publishing to NPM? Check out
rust-webpack-template
and/orrust-parcel-template
.
npm init wasm-app
Note You may face error like below:
(node:257464) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
node:internal/crypto/hash:69
this[kHandle] = new _Hash(algorithm, xofLen);
...
That error because of devDependencies
versions conflicted with you Node version.
You can simply update devDependencies
versions by below commands:
npm i -g npm-check-updates
ncu -u
npm install
Reference: https://stackoverflow.com/a/16074029/8093348
.gitignore
: ignoresnode_modules
LICENSE-APACHE
andLICENSE-MIT
: most Rust projects are licensed this way, so these are included for youREADME.md
: the file you are reading now!index.html
: a bare bones html document that includes the webpack bundleindex.js
: example js file with a comment showing how to import and use a wasm pkgpackage.json
andpackage-lock.json
:- pulls in devDependencies for using webpack:
- defines a
start
script to runwebpack-dev-server
webpack.config.js
: configuration file for bundling your js with webpack
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.