You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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的形式导出可以正常按需导入
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
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: