Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yamafaktory/rust-wasm-webpack
A simple boilerplate to get WebAssembly (WASM) code generated by Rust and bundled by Webpack!
https://github.com/yamafaktory/rust-wasm-webpack
rust rustlang wasm webassembly webpack
Last synced: about 2 months ago
JSON representation
A simple boilerplate to get WebAssembly (WASM) code generated by Rust and bundled by Webpack!
- Host: GitHub
- URL: https://github.com/yamafaktory/rust-wasm-webpack
- Owner: yamafaktory
- License: mit
- Archived: true
- Created: 2017-12-10T08:39:58.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-09T16:51:38.000Z (almost 5 years ago)
- Last Synced: 2024-09-25T20:16:01.942Z (about 2 months ago)
- Topics: rust, rustlang, wasm, webassembly, webpack
- Language: JavaScript
- Homepage:
- Size: 1.07 MB
- Stars: 88
- Watchers: 8
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rust-wasm-webpack 🏎️ [![Build Status](https://travis-ci.org/yamafaktory/rust-wasm-webpack.svg?branch=master)](https://travis-ci.org/yamafaktory/rust-wasm-webpack) [![npm version](https://img.shields.io/npm/v/rust-wasm-webpack.svg?style=flat)](https://www.npmjs.com/package/rust-wasm-webpack) [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
A simple boilerplate to get WebAssembly (WASM) code generated by Rust and bundled by Webpack!
This project now uses the awesome [rust-native-wasm-loader](https://github.com/dflemstr/rust-native-wasm-loader) 🚀.
## Prerequisite
To get started, we need to install **rustup**, the Rust toolchain installer:
```sh
curl https://sh.rustup.rs -sSf | sh
```Please refer to its [documentation](https://github.com/rust-lang-nursery/rustup.rs).
## Usage
### Setup
First, install the necessary NodeJS dependencies:
```sh
yarn
```The next step will update to the latest Rust nightly, add the `wasm32-unknown-unknown` toolchain and install [wasm-gc](https://github.com/alexcrichton/wasm-gc) from *git*. The latter is a small command to clean a wasm module and remove all unneeded exports, imports, functions, etc.
```sh
yarn setup
```### Build
*You can skip this step and directly launch the dev server.*
```sh
yarn build
```### Launch the dev server
```sh
yarn start
```Go to http://localhost:9000/ and enjoy!
## License
Released under the [MIT license](https://opensource.org/licenses/MIT) by Davy Duperron.