babel-collect-imports 从入口点递归收集所有内部和外部依赖项 安装 yarn add babel-collect-imports 用法 const { collectImportsSync } = require ( 'babel-collect-imports' ) ; let { internal , external } = collectImportsSync ( 'path/to/entry.js' ) ; // { internal: ['path/to/entry.js', 'path/to/import.js', 'path/to/other/import