When authoring a build plugin, I’d love to be able to specify where the entry point is and put it where I would like in my package. Currently (as far as I know) it must be the main/default export of the package.
In my case I am publishing the build plugin along with some other utilities meant to be consumed by the user and used in their source code, so would love for the default export to be freed up for the things they are importing more frequently, and put the build plugin on an additional export path.
This could work by supporting non-default export paths in the netlify.toml
file’s plugins section - for example:
[[plugins]]
package = "@my-org/some-package/non-default-export"
or by supporting some kind of entry path in the manifest.yml
(although not being forced into putting the manifest.yml at the root would also be nice)
name: my-build-plugin
entry: "dist/build-plugin/index.js"
or by looking for some non-standard key in package.json
{
// rest of your package.json ...
"netlify-build-plugin": "dist/build-plugin"
}
or by checking some non-default export path (like /netlify-build-plugin
) first before trying the default export.
Thanks!