Skip to content

Instantly share code, notes, and snippets.

@rizary
Last active October 16, 2020 10:43
Show Gist options
  • Select an option

  • Save rizary/df2bcbd6a1fd8ce7f2dced10eb56d8d3 to your computer and use it in GitHub Desktop.

Select an option

Save rizary/df2bcbd6a1fd8ce7f2dced10eb56d8d3 to your computer and use it in GitHub Desktop.
{
"name": "rust",
"version": "0.1.0",
"description": "frontend wasm in rust",
"license": "MIT",
"private": true,
"scripts": {
"todo_watch": "yarn run todo_clean && rollup -c rollup.dev.js --watch",
"todo_clean": "rimraf ./devhtml/js",
},
"dependencies": {
"@wasm-tool/rollup-plugin-rust": "^1.0.5",
"wasm-pack": "^0.9.1"
},
"devDependencies": {
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.29.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-serve": "^1.0.4",
"rollup-watch": "^4.3.1"
}
}
import rust from "@wasm-tool/rollup-plugin-rust";
import livereload from "rollup-plugin-livereload";
import serve from "rollup-plugin-serve";
export default {
input: {
index: 'Cargo.toml'
},
output: {
dir: "devhtml/js",
format: "iife",
sourcemap: true
},
plugins: [
rust({
serverPath: "/js/",
debug: true,
verbose: true,
watchPatterns: ["src/**"],
cargoArgs: ["--features", "develop"],
watch: true,
}),
serve({
contentBase: 'devhtml',
open: true,
verbose: true,
historyApiFallback: true,
}),
livereload({
watch: 'devhtml',
verbose: true
})
],
watch: {
clearScreen: false
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment