You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The transformIndexHtml is never called. This means a whole set of vite plugins will not work without any error message.
I understand there's a good reason why this vite plugin method cannot work with RR, but it should at least throw an error or warning to let the user know the plugin they installed will not work at all.
An alternative here would be writing our own shim using buildEnd:
exportdefault{ssr: false,buildDirectory: "build/"+process.env.NODE_ENV,asyncbuildEnd(args){// if (!args.viteConfig.isProduction) returnconstlog=args.viteConfig.logger// this plugin list is already filtered by each plugin's `apply` and is not the raw plugin// list specified onconstpluginList=args.viteConfig.plugins// first, let's find all plugins which implement transformIndexHtmlconstplugins=pluginList.filter((plugin)=>"transformIndexHtml"inplugin,)if(plugins.length===0){log.error("No plugins found which implement transformIndexHtml")return}// now let's run their transformation commandconstindexHTMLPath=args.viteConfig.build.outDir+"/index.html"for(constpluginofplugins){log.info(`Running transformIndexHtml for ${plugin.name}`)awaittransformHtmlWithPlugin(indexHTMLPath,plugin)}},}satisfiesConfig
but this doesn't work since buildEnd is not called in preview mode.
Actual Behavior
The index HTML is not transformed.
The text was updated successfully, but these errors were encountered:
This is related to #12352, since our plugin is overriding that subsequent plugin and doesn't allow for options to be able to inject your own plugin functionality into it.
I'm using React Router as a...
framework
Reproduction
Lifted from this Discord discussion.
The
transformIndexHtml
is never called. This means a whole set of vite plugins will not work without any error message.I understand there's a good reason why this vite plugin method cannot work with RR, but it should at least throw an error or warning to let the user know the plugin they installed will not work at all.
System Info
Used Package Manager
npm
Expected Behavior
Allow vite plugins to transform the index HTML.
An alternative here would be writing our own shim using
buildEnd
:but this doesn't work since
buildEnd
is not called in preview mode.Actual Behavior
The index HTML is not transformed.
The text was updated successfully, but these errors were encountered: