vite-plugin-externals icon indicating copy to clipboard operation
vite-plugin-externals copied to clipboard

[bug] xxx in "/index.html" can't be bundled without type="module" attribute

Open s3xysteak opened this issue 1 year ago • 1 comments

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
      }
    )

s3xysteak avatar Nov 08 '23 03:11 s3xysteak