umijs / father

NPM package development tool
MIT License
2.12k stars 273 forks source link

fix(esm): create package.json with module type, add import extensions… #742

Closed LouisStairwage closed 1 month ago

LouisStairwage commented 7 months ago

Do not accept the PR this way the code is error prone because of regex use for parsing imports in JS files.

Hi, this PR will be the first of serie for fixing ESM builds in antd galaxy libraries (antd-icons, rc-*, antd), father is used everywhere in these projects and could help fixing some issues describe by my coworker here : issue on rc-util, issue on antd

It adds :

LouisStairwage commented 7 months ago

Just as an edit, I just saw fatherBabelPluginImportLib2Es, these adjustments could be implemented in plugins using babel too and implemented in antd / rc projects. Any opinions on this ?

jer-sen commented 1 month ago

@sorrycc why did you close this PR ?