bic-build-if-changed
v2.1.0
Published
Run build scripts only when files changed.
Downloads
468
Maintainers
Readme
How it works
Look for
package.json
forbic
config (example config -"bic": ["src"]
).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
.If the stored hash of the project folders is outdated, then
bic
will executenpm run build
in the relevant project folder.
Usage
- Install the package:
npm i bic-build-if-changed -D
# or
yarn add bic-build-if-changed -D
- 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,
- 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
- 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.