new webpack.IgnorePlugin(/\.\/locale/, /moment/)
// 再导入中文包
import 'moment/locale/zh-cn'
// 错误
import useInterval from 'react-use'
// 正确
import useInterval from 'react-use/lib/useInterval'
// c.ts
export * from './a'
export * from './b'
// d.ts
import { a } from './c'
In this way, even if b is not used in d, b is packaged as a result of aggregation export. The advantage of aggregate exports may be to reduce the number of import statements at the top of the file. However, if the node server is not packaged, the impact of aggregate export should not be significant.