Last active
          March 21, 2025 13:34 
        
      - 
      
- 
        Save jrc03c/fcc76fa9219fd86310a4acd99689b14e to your computer and use it in GitHub Desktop. 
    generic build script
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | import { watch } from "@jrc03c/watch" | |
| import process from "node:process" | |
| 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