svelte(rollup) + wasm(rust) template
You need to ensure that the following commands can be executed:
cargo --version
rustup --version
npm --version
To compile WASM, the architecture wasm32-unknown-unknown
is required. If it's not installed, you can do so with the following command:
rustup target add wasm32-unknown-unknown
To build, an additional tool called wasm-pack
is needed. If it's not installed, you can install it with the following command:
cargo install wasm-pack
You can create a project using the following shell script:
create-svelte-wasm-project.sh svelte-wasm-normal
or
create-svelte-wasm-project.sh svelte-wasm-bundle bundle
Example of Execution:
cd svelte-wasm-bundle
npm install
wasm-pack build src/wasm-module --release --target web
npx rollup -c && npx http-server ./public
# or
npm run dev