chokibasic
v1.0.11
Published
Basic chokidar watcher + pxpros + esbuild + sass + csso helpers
Maintainers
Readme
chokibasic
Helpers:
createWatchers(rules, options)buildCSS(inputScss, outCssMin)buildJS(entry, outfile)
Install
npm i chokibasicUsage
const { createWatchers, buildCSS, buildJS } = require("chokibasic");
const w = createWatchers(
[
{
name: "css",
patterns: ["src/styles/**/*.scss"],
callback: async (events) => {
console.log("css events:", events);
await buildCSS("src/styles/main.scss", "dist/app.min.css");
}
},
{
name: "js",
patterns: ["src/scripts/**/*.js"],
ignored: ["**/*.min.js"],
callback: async (events) => {
console.log("js events:", events);
await buildJS("src/scripts/main.js", "dist/app.min.js");
}
}
],
{ debug: true }
);
// later: await w.close();
process.on("SIGINT", async () => {
await close();
process.exit(0);
});
