umijs / babel-plugin-import

Modularly import plugin for babel.
3.15k stars 403 forks source link

ImportDeclaration(path, state){} 监听 可以会比 CallExpression(path, state) {} 监听 后执行。 #630

Open curry-wxj opened 1 year ago

curry-wxj commented 1 year ago

ImportDeclaration(path, state){} 监听 可以会比 CallExpression(path, state) {} 监听 后执行。 例如:

  import { Component } from "react";
import { Table, Select, Message } from "@alifd/next";
console.log(Table, Select, Message)

有一个插件 会将 import { Table, Select, Message } from "@alifd/next"; 处理成 import { Table, Message } from "@alifd/next"; import Select from './MySelect'; 处理完后 会先进入 CallExpression处理 console.log(Table, Select, Message) 才会在 进入ImportDeclaration 搜集 import { Table, Message }的 依赖。 请问大佬们有什么解决方案吗