Wireit
Upgrade your npm scripts to make them smarter and more efficient
README
Features
- 🙂 Use the npm run commands you already know
- ⛓️ Automatically run dependencies between npm scripts in parallel
- 👀 Watch any script and continuously re-run on changes
- 🥬 Skip scripts that are already fresh
- ♻️ Cache output locally and remotely on GitHub Actions for free
- 🛠️ Works with single packages, npm workspaces, and other monorepos
Contents
- Features
- Install
- Setup
- Caching
- Services
- Recipes
- ESLint
Install
- ```sh
- npm i -D wireit
- ```
Setup
Wireit works _with_ npm run, it doesn't replace it. To configure an NPM script
for Wireit, move the command into a new wireit section of your package.json,
and replace the original script with the wireit command.
Before | After |
---|---|
|
|
Now when you run npm run build, Wireit upgrades the script to be smarter and
more efficient. Wireit works with yarn
(both 1.X "Classic" and its successor "Berry")
and pnpm, too.
You should also add .wireit to your .gitignore file. Wireit uses the
.wireit directory to store caches and other data for your scripts.
- ```sh
- echo .wireit >> .gitignore
- ```
VSCode Extension
If you use VSCode, consider installing the google.wireit extension. It adds documentation on hover, autocomplete, can diagnose a number of common mistakes, and even suggest a refactoring to convert an npm script to use wireit.
Install it from the marketplace or on the command line like:
- ```
- code --install-extension google.wireit
- ```
Dependencies
To declare a dependency between two scripts, edit the
`wireit.