mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 03:05:38 -05:00
committed by
GitHub
parent
13604e0a47
commit
28d37cdead
31
pyscript.core/dev.cjs
Normal file
31
pyscript.core/dev.cjs
Normal file
@@ -0,0 +1,31 @@
|
||||
let queue = Promise.resolve();
|
||||
|
||||
const { exec } = require("node:child_process");
|
||||
|
||||
const build = (fileName) => {
|
||||
if (fileName) console.log(fileName, "changed");
|
||||
else console.log("building without optimizations");
|
||||
queue = queue.then(
|
||||
() =>
|
||||
new Promise((resolve) => {
|
||||
exec(
|
||||
"npm run build:stdlib && npm run build:plugins && npm run build:core",
|
||||
{ cwd: __dirname, env: { ...process.env, NO_MIN: true } },
|
||||
(error) => {
|
||||
if (error) console.error(error);
|
||||
else console.log(fileName || "", "build completed");
|
||||
resolve();
|
||||
},
|
||||
);
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
const options = {
|
||||
ignored: /\/(?:toml|plugins|pyscript)\.[mc]?js$/,
|
||||
persistent: true,
|
||||
};
|
||||
|
||||
require("chokidar").watch("./src", options).on("change", build);
|
||||
|
||||
build();
|
||||
Reference in New Issue
Block a user