Adding a custom plugin to a Vue app

I added a plugin folder with index.js and manifest.yml files to the root of the app, but I still get a configuration error when deploying it. It says it cannot find a plugin using the specified path.

Here is my structure:

  • node_modules
  • plugins
    – index.js
    – manifest.yml
  • public
  • src
  • .gitignore
  • babel.config
  • netlify.toml
  • package.json
  • package-lock.json
  • README

index.js

module.exports = {
  onPreBuild: ({ utils }) =>  {
	  utils.status.show({
		title: 'Hello from the build plugin',
		summary: 'Pre build is starting...',
		text: 'Some more info...'
	 });
  },
  onSuccess: () => {
	console.log("onSuccess event...");
  },
}

manifest.yml

name: netlify-test-plugin

netlify.toml

[[plugins]]
package = "/plugins/netlify-test-plugin"

I also tried “.plugins/netlify-test-plugin” and “./plugins/netlify-test-plugin”

Hi @romaldowoho,

From your file structure, it appears that index.js is directly under plugins/? If so, package = "./plugins/index.js" would find the plugin path.

1 Like

Thank you @ehmicky ! That makes sense, I was just blindly following the docs…