Skip to content

FOR ANYONE WHO IS GOING THROUGH THE STEPS IN 'Hello, World' AND HAS ERRORS #309

Open
@magnus-ISU

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions