netlify-plugin-cache-yarn2
Version:
Save the Yarn 2 cache folder between Netlify builds
41 lines (28 loc) • 1.74 kB
Markdown
# [Netlify Yarn 2 cache](https://app.netlify.com/plugins/netlify-plugin-cache-yarn2/install)
Save the Yarn 2 cache folder between Netlify builds.
[](https://app.netlify.com/plugins/netlify-plugin-cache-yarn2/install)
[](https://www.npmjs.com/package/netlify-plugin-cache-yarn2)
[](https://www.npmjs.com/package/netlify-plugin-cache-yarn2)
[](https://github.com/pizzafox/netlify-plugin-cache-yarn2/actions)
A [Netlify build plugin](https://docs.netlify.com/configure-builds/build-plugins/).
## Usage
This is a Netlify build plugin, which will run during your Netlify builds. You can learn more about Netlify Build Plugins in the [Netlify docs](https://docs.netlify.com/configure-builds/build-plugins/).
If you want to manually install the plugin add the following lines to your `netlify.toml` file:
```toml
[[plugins]]
package = "netlify-plugin-cache-yarn2"
```
Next, from your project's base directory, use a package manager to add this plugin to `devDependencies` in `package.json`.
```sh
yarn add -D netlify-plugin-cache-yarn2
```
If you want to configure the plugin, you can do this in your `netlify.toml` file:
```toml
[[plugins]]
package = "netlify-plugin-cache-yarn2"
[plugins.inputs]
# The path to the Yarn lockfile
# Default is yarn.lock
build_dir_path = "frontend/yarn.lock"
```
Note: The `[[plugins]]` line is required for each plugin, even if you have other plugins in your `netlify.toml` file already.