ElementUI / babel-plugin-component

Modular element-ui build plugin for babel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

同一个项目中,既包含了全量引入,又包含了按需引入,然后有如下报错,请教下如何解决?

mexhfl opened this issue · comments

error in ./src_form/main.js

Syntax Error: Error: D:\Project\jc_forms_git\src_form\main.js: [babel-plugin-component] If you are using bothon-demand and importing all, make sure to invoke the importing all first.
at Array.map ()

@ multi (webpack)-dev-server/client?http://192.168.1.208:8080/sockjs-node (webpack)/hot/dev-server.js ./src_form/main.js

error in ./src_report/main.js

Syntax Error: Error: D:\Project\jc_forms_git\src_report\main.js: [babel-plugin-component] If you are using bothon-demand and importing all, make sure to invoke the importing all first.
at Array.map ()

@ multi (webpack)-dev-server/client?http://192.168.1.208:8080/sockjs-node (webpack)/hot/dev-server.js ./src_report/main.js

error in ./src_todo/main.js

Syntax Error: Error: D:\Project\jc_forms_git\src_todo\main.js: [babel-plugin-component] If you are using bothon-demand and importing all, make sure to invoke the importing all first.
at Array.map ()

@ multi (webpack)-dev-server/client?http://192.168.1.208:8080/sockjs-node (webpack)/hot/dev-server.js ./src_todo/main.js

按照babel-plugin-component给出的提示,如果既有全局又有按需引入的话,你应该先全局引入,再按需引入。