1.6.3 • Published 7 months ago
@chuyik/build-if-changed v1.6.3
build-if-changed
Build your packages only if they changed since the last build.
How it works
Look for
package.jsonmodules in the working directory, ignoring anynode_modulesdirectories by default. Any local.gitignoreis also respected.Crawl the package and generate SHA-1 hashes from every watched file. These hashes are stored in the
.bic_cachefile next to eachpackage.jsonmodule.If any
.bic_cachefiles are outdated, thenbicwill executenpm run buildin the relevant packages.
Usage
- Install the package:
yarn add build-if-changed -D- Edit your
package.jsonmodule to customize the behavior:
// Only watch the "src" directory:
"bic": ["src/**"],
// Any glob can be included or excluded:
"bic": { "only": [], "skip": [] },
// Disable bic for a package:
"bic": false,- Use the package:
yarn bic
yarn bic --help
yarn bic --dir some-dir
yarn bic --ignore some-name
Notes
- The
skipconfig takes precedence over theonlyconfig. - The
.gitandnode_modulesdirectories are always skipped. - This tool uses a custom glob syntax (see here).