mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-24 01:40:41 +02:00
watch utils folder and build it when updated
This commit is contained in:
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");
|
||||
});
|
Reference in New Issue
Block a user