From ef53aeebc7ab2e4814d76f46cd7922eb64af7d38 Mon Sep 17 00:00:00 2001 From: Phoomparin Mano Date: Sun, 17 Dec 2023 11:55:54 +0700 Subject: [PATCH] fix: workaround for wasm-pack producing wrong type declarations for dev profile --- canvas/package.json | 3 ++- canvas/rsw.toml | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/canvas/package.json b/canvas/package.json index 773b5b09..f225bce2 100644 --- a/canvas/package.json +++ b/canvas/package.json @@ -4,8 +4,9 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "concurrently \"rsw watch\" \"vite\"", + "dev": "concurrently 'rsw watch' 'vite'", "build": "source ./ci-setup.sh && rsw build && tsc && vite build", + "watch:rs": "cd machine-wasm && cargo watch --workdir .. --watch ../machine/src --watch machine-wasm/src -s 'wasm-pack build machine-wasm --out-dir pkg-release --target web --release'", "rsw": "rsw", "lint": "eslint --ext ts,tsx --report-unused-disable-directives --max-warnings 0 .", "lint:fix": "eslint --fix --ext ts,tsx --report-unused-disable-directives --max-warnings 0 .", diff --git a/canvas/rsw.toml b/canvas/rsw.toml index ef84c69a..2ae02330 100644 --- a/canvas/rsw.toml +++ b/canvas/rsw.toml @@ -1,4 +1,4 @@ -name = "machin" +name = "machine" version = "0.1.0" # default is 50 milliseconds @@ -12,3 +12,8 @@ using = "wasm-pack" [[crates]] name = "machine-wasm" link = true +target = "web" +out-dir = "pkg" + +[crates.watch] +profile = "release"