mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
watch utils folder and build it when updated
This commit is contained in:
parent
58567dd2b6
commit
7522285869
4 changed files with 20 additions and 2 deletions
16
scripts/watchUtils.js
Normal file
16
scripts/watchUtils.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
const chokidar = require("chokidar");
|
||||
const path = require("path");
|
||||
const { execSync } = require("child_process");
|
||||
|
||||
const BASE_PATH = `${path.resolve(`${__dirname}/..`)}`;
|
||||
const utilsDir = `${BASE_PATH}/packages/utils/src`;
|
||||
// One-liner for current directory
|
||||
chokidar.watch(utilsDir).on("change", (event) => {
|
||||
console.info("Watching", event);
|
||||
try {
|
||||
execSync(`yarn workspace @excalidraw/utils run build:src`);
|
||||
} catch (err) {
|
||||
console.error("Error when building workspace", err);
|
||||
}
|
||||
console.info("BUILD DONE");
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue