vite-plugin-externals
vite-plugin-externals copied to clipboard
[bug] xxx in "/index.html" can't be bundled without type="module" attribute
It correctly work but report a warning while building
<script src="xxx.js"> in "/index.html" can't be bundled without type="module" attribute
Then I edit it as <script type="module" src="xxx.js">
but it report error:
Error: [vite]: Rollup failed to resolve import "xxx.js" from ".../index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
And here is my viteExternalsPlugin config:
viteExternalsPlugin(
{ xxx: 'Xxx' },
{
disableInServe: true
}
)