vite-plugin-html
vite-plugin-html copied to clipboard
打包时候报警告 in "/index.html" can't be bundled without type="module" attribute
是否可以消除这个警告
试了直接报错
我也遇到了这个问题,请问最后如何解决了呢
首先设置 inject.tags.attrs.type = "module", 然后把 vite-plugin-html配置中的 inject.tags.attrs.src 添加到 vite.config.js 中的 build.rollupOptions.external 中
如果不是第三方包怎么external
@sunchengfeng01 哥们你解决了吗,我也遇到这个问题了
+1
@sunchengfeng01, @eveforest, @s3xysteak
Here what works for me:
vite.config.ts
build.rollupOptions.external: [/^(.*)_app.config.js(.*)/],
html.ts // vite-plugin-html
inject.tags.attrs.type = "module",