Skip to content

charan0017/bic-build-if-changed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bic-build-if-changed

Build your packages only if they changed since the last build.

 

How it works

  1. Look for package.json for bic config (example config - "bic": ["src"]).

  2. Crawl the folders that are defined in config and generates a combined SHA-1 hash of all the files in defined folders. The hashes are stored in ./node_modules/bic-build-if-changed/cache.

  3. If the stored hash of the project folders is outdated, then bic will execute npm run build in the relevant project folder.

 

Usage

  1. Install the package:
npm i bic-build-if-changed -D
# or
yarn add bic-build-if-changed -D
  1. Edit your package.json module to customize the behavior:
// Only the "src" & "public" directories:
"bic": ["src", "public"],
// Disable bic for a package:
"bic": false,
// Use default directories ("src"):
"bic": true,
  1. Use the package: (using with npm)
npm run build-if-changed
# or
npm run bic
# you can use -force (or) -F flag to Force Re-Build
npm run bic -F
  1. Use the package: (using with yarn)
yarn build-if-changed
# or
yarn bic
# you can use -force (or) -F flag to Force Re-Build
yarn bic -F

 

Notes

  • Only bic config directories are watched, by default ./src directory is only watched.

 

Inspiration

https://github.com/alloc/build-if-changed

About

Run build scripts only when files changed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published