You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resolveId() method of the plugin model exposes the importee and importer path strings.
If an importNames variable was also exposed, it would expand the possibilities of plugins using the method.
// importNames examplesresolveId(importee,importer,importNames){// Default import// import SomeModule from "SomeModule";importNames==="SomeModule";// Named imports// import { SubModuleA, SubModuleB } from "SomeModule";importNames===["SubModuleA","SubModuleB"];}
I wrote a plugin that specifically needs access to the import names to dedupe imports by forcing them to come from a single source. The plugin sits in between multi-entry and node-resolve. There is more info in the README of the plugin I linked.