esbuild bundle=true causing unplugin-auto-import invalid #14572
Unanswered
cest-la-v
asked this question in
CLI - BEX mode
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I've just start using quasar to build browser extensions, when I'm trying to reuse codes between
src-bex/background.tsandsrc, I found out that the modules auto imported byunplugin-auto-importwon't be available in the built outputdist/backgroud.js.I see you are using
bundle: trueto inline all the modules needed by background/content/dom script and bundle them into single outputs.I've extended
esbuildconfig like this:Yet, the modules supposed to be auto imported still won't be inlined into the output files.
I'm guessing this is caused by the
bundle=truefeature can only inline the imports analyzable at compile-time but not runtime (https://esbuild.github.io/api/#non-analyzable-imports), while the auto imported modules are actually analyzable until runtime (dynamic imports?). Thus,esbuildin bundle mode does not supportunplugin-auto-import?It is a bit hideous to collect all the shared code in one special place and only able to use manual import on them in the bex scripts.
Are you planning on to use
Viteto build background/content/dom script as well as theBEX UIitself, instead of using an extra build toolesbuild? I thinkVitealso support building bundled single script file like this vitejs/vite#2739.Beta Was this translation helpful? Give feedback.
All reactions