dynamic import when using babel transpiling in node_module library

Viewed 106

Situations:

  1. I have a library A which used "import" to split code, and it is a react component library.
  2. my project named B which depends on the library A.
  3. the code splitting works perfectly if I import library A's source code directly.
  4. but if I transpile the library A by babel at first, then import the transpiled code in project B. The effect of code splitting in library A was disappeared.

Questions:

How can I import library A's transpiled code and keep its code-splitting effect?

0 Answers
Related