Open
Description
Run the following code instead:
cargo generate --git https://github.com/rustwasm/wasm-pack-template # Type wasm-game-of-life
and then
cd wasm-game-of-life
wasm-pack build
npm init wasm-app www
# Fix dependencies. We will first install sd to make replacing text easier and cross-platform and rusty.
cargo install sd
sd ' "devDependencies": \{
"hello-wasm-pack": "\^0.1.0",
"webpack": "\^4.29.3",
"webpack-cli": "\^3.1.0",
"webpack-dev-server": "\^3.1.5",
"copy-webpack-plugin": "\^5.0.0"
\}' ' "dependencies": {
"wasm-game-of-life": "file:../pkg"
},
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",
"hello-wasm-pack": "^0.1.0",
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}' www/package.json
cd www
rm package-lock.json
npm install
# Fix webpack config
sd -F "new CopyWebpackPlugin(['index.html'])" 'new CopyWebpackPlugin({ patterns: ["index.html"] })' webpack.config.js
sd '^\}' ' experiments: { asyncWebAssembly: true },\n}' webpack.config.js
npm run start
This should work in bash
. In zsh
you can just run it all at once for some reason
Metadata
Assignees
Labels
No labels
Activity