Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local web development option. #8

Open
rparrett opened this issue Aug 2, 2022 · 2 comments
Open

Local web development option. #8

rparrett opened this issue Aug 2, 2022 · 2 comments

Comments

@rparrett
Copy link
Contributor

rparrett commented Aug 2, 2022

It would be great to have some instructions or scripts or something for users to easily do local testing/development for the web.

There are a bunch of ways to break a web build and the feedback loop could be substantially shortened.

@bardt
Copy link

bardt commented Nov 24, 2022

In my project, I made a .justfile with something like this:

default: run

build-wasm:
    cargo build --release --target wasm32-unknown-unknown --no-default-features
    wasm-bindgen --no-typescript --out-name bevy_game --out-dir wasm --target web target/wasm32-unknown-unknown/release/my_game.wasm
    cp -r assets wasm/

run: build-wasm
    sfz ./wasm

It runs the same commands as in CI, and I can do $ just run to build for WASM and start local server

@rparrett
Copy link
Contributor Author

rparrett commented Nov 24, 2022

That's great info to collect here.

I've been using cargo make in mine to do something similar. It's sort of nice because you can write the tasks in cross-platform "duckscript." and it has some built-ins for ensuring crates like wasm-bindgen and a local dev server are installed.

We could also recommend wasm-server-runner, but I'm not a fan of that here because it uses its own separate index.html and there's no way to change that as far as I can tell.

I think the main reason this hasn't been done in-repo is that there are a lot of options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants