samrum / vite-plugin-web-extension

A vite plugin for generating cross browser platform, ES module based web extensions.
MIT License
325 stars 32 forks source link

Dynamic imports broken with 2.0.0 #53

Closed heathsnee closed 1 year ago

heathsnee commented 1 year ago

I updated version from 1.0.0 to 2.0.0 and my dynamic imports from javascript files are broken now

code:

import('./polyfills').then(() => /* ... */)

output:

BEFORE:

()=>import("./polyfills.js"),["assets/polyfills.js","assets/browser.js"])

AFTER:

()=>import((chrome!=null?chrome:browser).runtime.getURL("./polyfills.js")),[])

Where the build output for ./polyfills is assets/polyfills.js

samrum commented 1 year ago

Can you provide a little more info about the layout of the files you're using/importing? Maybe push an example to a repo somewhere?