Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

build-if-changed

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-if-changed

Run build scripts only when files changed

  • 1.5.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
decreased by-13.94%
Maintainers
2
Weekly downloads
 
Created
Source

build-if-changed

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

 

How it works

  1. Look for package.json modules in the working directory, ignoring any node_modules directories by default. Any local .gitignore is also respected.

  2. Crawl the package and generate SHA-1 hashes from every watched file. These hashes are stored in the .bic_cache file next to each package.json module.

  3. If any .bic_cache files are outdated, then bic will execute npm run build in the relevant packages.

 

Usage

  1. Install the package:
yarn add build-if-changed -D
  1. Edit your package.json module 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,
  1. Use the package:
yarn build-if-changed
# or
yarn bic

 

Notes

  • The skip config takes precedence over the only config.
  • The .git and node_modules directories are always skipped.
  • Any package with bic or build-if-changed in its "build" script is skipped.
  • This tool uses a custom glob syntax (see here).

FAQs

Package last updated on 23 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc