wasm-chrome-boilerplate
wasm-chrome-boilerplate copied to clipboard
Boilerplate for creating chrome extensions using web assembly with rust.
wasm-chrome-boilerplate
This is a boilerplate for making chrome extensions with typescript, scss, and wasm generated by rust. This can also be a starter for making regular web apps in wasm.
Getting Started
Make sure you have wasm-pack downloaded before running.
-
From the root directory, run
npm install npm run build -
Then open chrome and navigate to
chrome://extensions/. ClickLoad unpacked, and select the~/distdirectory. When you open a new tab or the popup in the top right, you should see a list of buttons that use wasm-bindgen. -
Alternatively, you can also run the app on a local server. Simply run
npm run startand then go to
localhost:8080.
Remarks
Note that ~/src/popup/bootstrap.js is a js file. This is because ts-loader doesn't integrate very well with asynchronous imports, which are required for importing wasm modules.