-
-
Notifications
You must be signed in to change notification settings - Fork 378
Closed
Description
Describe the bug
1、公司有自己的组件库开发团队,但是所有组件都是export default ,没有添加export {}/
2、使用插件处理时,最终编译后是这种import {AButton as __unplugin_components_1} from "/node_modules/.vite/deps/@a-button_lib_index__js.js?v=9f7b1eed";
3、但是文件a-button_lib_index__js.js里面导出的是这种形式export {
lib_default as default
// 如果添加了export { AButton } 这里会多一个下面的导出
lib_default as AButton
};
导致编译的时候直接报错:
SyntaxError: The requested module '/node_modules/.vite/deps/a-button_lib_index__js.js?v=9f7b1eed' does not provide an export named 'AButton
请问如何解决组件没有用export {}而是用export default的形式导出可以正常按需导入
Reproduction
Reproduction
System Info
windows
Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
Metadata
Metadata
Assignees
Labels
No labels