Netlify Build Plugins extend the functionality of the Netlify Build process. You can install plugins made by others, or write your own. You can save them locally in your repository, or share them with others via npm and the Netlify plugins directory.
Build Plugins expand what your Netlify builds are capable of. For example, you can use plugins to:
- speed up builds by optimizing and debugging your build cache
- import and convert data from external sources
- check for broken links in a site after building
- analyze and optimize site asset handling for better runtime performance
- generate content like sitemaps, RSS feeds, and search indexes
Install a plugin
To get a sampling of what plugins can do, visit the Build Plugins product page or the in-app plugins directory. All plugins listed on those pages can be installed directly from the Netlify UI. They can also be installed via Netlify configuration file, which allows greater configuration options and a broader selection of plugins.
To install plugins via the Netlify UI, go to your team sites list and select the Plugins tab (or follow this direct link to the plugins directory).
The Options dropdown menu in each plugin listing includes links to the plugin docs, npm package profile, and issue tracker. You can use this information to decide if the plugin is right for your site. When you're ready to install, click the Install button. This will direct you to a site selection screen.
Current build image required
Build Plugins are not available on the legacy "Ubuntu Trusty 14.04" build image. To update your site build image, go to Settings > Build & deploy > Continuous deployment > Build image selection > Edit settings, and select "Ubuntu Xenial 16.04".
You can use the search box to find sites across all of your teams.
To run a build with your new plugin, you can visit the site Deploys tab and select Trigger deploy.
Required environment variables
Though most plugins that can be installed via the Netlify UI require no configuration for default operation, some may require you to set one or more build environment variables. Refer to the plugin's documentation, linked from the Options menu for the plugin listing in the Netlify UI, for details.
For plugins not listed in the Netlify UI, or for advanced plugin configuration, you can install plugins for your Netlify site by adding them to your Netlify configuration file. Here is a sample configuration with two plugins installed:
[[plugins]] package = "my-awesome-plugin" [[plugins]] package = "replace-images-with-kittens" [plugins.inputs] colors = ["orange tabby", "black with socks"]
[[plugins]] entry accepts two keys:
package(required): the npm package name of the plugin.
inputs: custom settings which the plugin author may specify as required or available for configuring the plugin.
You can find these details in each plugin's package documentation on the npm Public Registry.
Sometimes order matters
Different plugins run during different stages of your build. When multiple plugins are set to run in the same stage, they will run in the order they are listed in the Netlify configuration file. A plugin's README will indicate if order is important to that plugin's functionality.
When you save your changes to your Netlify configuration file and push them to your linked repository, the build that's triggered will run with your newly installed plugins. If you would like to test a plugin before running it in a production build, you can use a branch deploy or Deploy Preview, or you can run the build locally with Netlify CLI.
Remove a plugin
The steps for removing a plugin depend on how the plugin was installed.
For plugins installed via UI, find the plugin entry on the site's Plugins page. (Note this is not the same as the plugins directory which is linked at the team level.) Click the plugin's Options menu and select Uninstall. Subsequent builds will not use the uninstalled plugin.
For plugins installed via Netlify configuration file, delete or comment out the plugin's configuration fields from your configuration file. When you push your committed changes, the build that's triggered will run without the plugin.
Create a plugin
Once you've had a chance to try out some community-built plugins, you may want to make one of your own. To learn how, visit the create plugins doc.
Netlify Build Plugins are created by developers at Netlify and in the community. If you need help with a plugin, contact the plugin author by submitting an issue on the plugin repository. For plugins in the Netlify UI, you can find a link to the plugin issues under the Options menu for the plugin listing. If a plugin author doesn't respond to an issue within a week, you can request deactivation of the plugin from the Netlify UI.
For more general questions, or to discuss Build Plugins with other members of the community, visit the Netlify community forums.
Did you find this doc useful?
Your feedback helps us improve our docs.