-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I want to use it with vite-plugin-federation, but I found that vite-plugin-dynamic-import cannot be resolved.
vite.config.js
plugins: [
vue(),
dynamicImport(),
federation({
name: 'edoms-runtime',
remotes: {
'remote-ui': 'http://localhost:8001/assets/remoteEntry.js',
},
shared: ['vue', 'element-plus'],
}),
],main.ts
edomsApp.component(
'UiButton',
defineAsyncComponent(async () => {
const component = 'button';
// @ts-ignore
const remoteUi = await import(`remote-ui/${component}`);
return remoteUi.default.component;
})
);result
X [ERROR] [plugin vite-plugin-dynamic-import:pre-bundle] invalid import "import(`remote-ui/${component}`)". Variable bare imports are not supported, imports must start with ./ in the static part of the import. For example: import(`./foo/${bar}.js`).Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
