Last active
October 16, 2020 10:43
-
-
Save rizary/df2bcbd6a1fd8ce7f2dced10eb56d8d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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