From 9ed1fccd1d27888fc4bbbfc9dcd7f92326f9a562 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 16 Jul 2021 10:49:52 +0200 Subject: [PATCH] Two improvements to the development workflow (#270) * Configure rust-analyzer to target wasm32-unknown-unknown * Watch changes to core rust files --- .vscode/settings.json | 3 ++- README.md | 2 +- client/web/vue.config.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 578dfa12..0cc44eca 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,6 +12,7 @@ "editor.defaultFormatter": "dbaeumer.vscode-eslint", }, "rust-analyzer.experimental.procAttrMacros": true, + "rust-analyzer.cargo.target": "wasm32-unknown-unknown", "files.eol": "\n", "html.format.wrapLineLength": 200, "eslint.format.enable": true, @@ -23,4 +24,4 @@ "typescript", ], "vetur.format.enable": false, -} \ No newline at end of file +} diff --git a/README.md b/README.md index b66aa9d5..bb031148 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ This is the primary means of running and developing the project. You may need to npm run serve ``` -The server automatically watches for changes to Vue files and rebuilds them. However core Rust and TypeScript file changes require a manual restart of the development server. (Please submit a PR to help it watch the `.ts` files!) +The server automatically watches for changes to Vue files and rebuilds them. However TypeScript file changes require a manual restart of the development server. (Please submit a PR to help it watch the `.ts` files!) You can also use `npm run lint` and `npm run lint-no-fix` to solve web formatting and `cargo fmt` for Rust formatting. Also `npm run build` writes static files to `/client/web/dist` instead of serving them from memory. diff --git a/client/web/vue.config.js b/client/web/vue.config.js index df29deb2..d932c9ee 100644 --- a/client/web/vue.config.js +++ b/client/web/vue.config.js @@ -13,6 +13,7 @@ module.exports = { (Plugin) => new Plugin({ crateDirectory: path.resolve(__dirname, "wasm"), + watchDirectories: [path.resolve(__dirname, "../../core")], }) ) .end();