-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic imports with variables in a dependency are not processed at all #6179
Comments
I can reproduce this in Vite 2.9.1. Looks like this is because dynamic import is disable in export default defineConfig({
build: {
dynamicImportVarsOptions: {
exclude: []
}
}
}) Sending a PR to remove it. |
I found that 'importAnalysisBuild' also ignores I think dynamic import from the node module, it is possible to repackage public variables within the package once. |
@poyoho Are you proposing that |
Describe the bug
Variable dynamic imports such as
import(`./inc/${name}.js`)
that appears in a dependency are not transpiled at all.Maybe related to #1903.
Reproduction
https://github.com/balthild/vrt-esmdi
/testlib2
- The dependency that contains variable dynamic imports/app
- A vite app/app/es
- A copy of/testlib2/es
Step
cd vrt-esmdi/app
yarn && yarn build
dist
and you can find that there's nothing corresponding to/testlib2/es/inc/*.js
which is dynamically imported./app/main.js
and change the first line toimport { testImport } from './es';
yarn build
Since the contents of
/testlib2/es
and/app/es
are identical, so I think the import expressions are treated differently when they're in the app or in a dependency.System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: