-
-
Notifications
You must be signed in to change notification settings - Fork 835
Dynamic import not statically analyzable breaks tools like vite #2827
Description
Stencil version:
@stencil/core@2.4.0
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
The following code relies on webpack specific import behaviour, other tools like vite and esbuild won't work because the import path is not statically analyzable without evaluating the expression
Expected behavior:
Import calls should be statically analyzable, replace loadModule() with a direct import() call
Steps to reproduce:
https://github.com/haikyuu/vite-ionic
The same thing happens with esbuild, it isn't able to bundle the dynamic import and it will fail at runtime
https://github.com/remorses/stencil-reproduce-2827
Related code:
Other information: