netlify-plugin-cache-yarn2

Save the Yarn 2 cache folder between Netlify builds.

Usage no npm install needed!

<script type="module">
  import netlifyPluginCacheYarn2 from 'https://cdn.skypack.dev/netlify-plugin-cache-yarn2';
</script>

README

Netlify Yarn 2 cache

Save the Yarn 2 cache folder between Netlify builds.

add to netlify npm downloads per week Build Status

A Netlify build plugin.

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.

If you want to manually install the plugin add the following lines to your netlify.toml file:

[[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.

yarn add -D netlify-plugin-cache-yarn2

If you want to configure the plugin, you can do this in your netlify.toml file:

[[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.