Created
March 24, 2018 20:01
-
-
Save robcalcroft/1802b1a64504544e5423a1dc74e6eee4 to your computer and use it in GitHub Desktop.
Super simple build tool for watching and running static builds - watches recursively unlike some watching tools out there
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 fs = require('fs'); | |
const build = () => { | |
console.info('Building'); | |
// Run your build here | |
}; | |
const watchAndBuild = () => { | |
console.info('Watching files for rebuild'); | |
fs.watch('src', { recursive: true }, build); | |
}; | |
if (process.argv[2] === 'watch') watchAndBuild(); | |
else build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment