bic-build-if-changed

2.1.0 • Public • Published

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

Package Sidebar

Install

npm i bic-build-if-changed

Weekly Downloads

105

Version

2.1.0

License

MIT

Unpacked Size

9.72 kB

Total Files

8

Last publish

Collaborators

  • charan0017