This plugin is using zip-it-and-ship-it directly to bundle a Function which is being dynamically added.
Calling zip-it-and-ship-it in this instance is creating several bugs (including this one). This is because the logic behind zip-it-and-ship-it is now more complex than it used to be: there can be multiple source directories, configuration options, feature flags, etc. Those new details are lost when netlify-plugin-search-index calls zip-it-and-ship-it again.
Fortunately, it turns out that Netlify now automatically bundles Functions added inside builds, providing the Function is added inside onPreBuild or onBuild. So, it feels like it should be possible to just remove that line of code and change the event from onPostBuild to onBuild?
This plugin is using
zip-it-and-ship-itdirectly to bundle a Function which is being dynamically added.Calling
zip-it-and-ship-itin this instance is creating several bugs (including this one). This is because the logic behindzip-it-and-ship-itis now more complex than it used to be: there can be multiple source directories, configuration options, feature flags, etc. Those new details are lost whennetlify-plugin-search-indexcallszip-it-and-ship-itagain.Fortunately, it turns out that Netlify now automatically bundles Functions added inside builds, providing the Function is added inside
onPreBuildoronBuild. So, it feels like it should be possible to just remove that line of code and change the event fromonPostBuildtoonBuild?