What is best approach to test in-development netlify-build-plugins on Netlify before they are "published"?

Locally, it seems/seemed to be to use a relative path to the plugin from a linked netlify deployment like this netlify.toml:

package = "..\\netlify-plugins\\netlify-plugin-jest\\"

  skipTests = false

package = "@netlify/plugin-local-install-core"


Hi @moop-moop,

Thanks for reaching out.
Yes, this is the recommended approach.

@ehmicky I found this appraoch useful too, when I required an “official” build:

Testing plugin on an actual Netlify Build/Deploy without a released npm

The plugin can be tested without using an actual released npm package by doing the following:

  1. Figure out the branch/tag/commit etc of the plugin to test, and install it as a package in the Netlify site you will use for testing:
    npm install UWHealth/netlify-plugin-jest#<branch/tag/commit>
  2. Change the Netlify site’s toml configuration:
package = "./node_modules/netlify-plugin-jest"
  extraLogging = true

package = "@netlify/plugin-local-install-core"
  1. Make sure to clear the build/deploy cache when you build/redeploy the testing site on Netlify. This will pull down a clean copy of the plugin code from the branch/tag/commit specified in the package.json after the npm install .
  2. Uninstall the Github sourced npm afterwards if the site is to be used for production purposes.
1 Like

Thanks for sharing @moop-moop!