Skip to content

Add option to automatically rewrite script declaration in the index.html file

Currently the <script> declaration in the main index.html file needs to be different for standard KGP webpack based tooling and for the Vite plugin. Additionally the Vite plugin needs js or mjs file extension, depending on the module kind configured for the Kotlin/JS compiler. I propose adding an autoRewriteIndex option, which will enable automatic rewriting of the typical <script src="app.js"></script> declaration (used by most K/JS projects) to the correct format for Vite plugin.