Last active
June 13, 2023 17:21
-
-
Save jrc03c/fcc76fa9219fd86310a4acd99689b14e to your computer and use it in GitHub Desktop.
generic build script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const process = require("process") | |
const watch = require("@jrc03c/watch") | |
function rebuild() { | |
console.log("-----") | |
console.log(`Rebuilding... (${new Date().toLocaleString()})`) | |
try { | |
// do stuff... | |
console.log("Done! 🎉") | |
} catch (e) { | |
console.error(e) | |
} | |
} | |
if (process.argv.indexOf("-w") > -1 || process.argv.indexOf("--watch") > -1) { | |
watch({ | |
target: ".", | |
exclude: ["node_modules"], | |
created: rebuild, | |
modified: rebuild, | |
deleted: rebuild, | |
}) | |
} | |
rebuild() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment