This encapsulates the logic for turning an acceptable plugin name into the absolute path for that plugin. It can be used to preprocess a plugins list to map each plugin to its absolute path, which is necessary if `babel.transform` is going to be executed on a file outside the directory subtree where the plugins are installed. This adds a getPossiblePluginNames helper encapsulating the logic for what plugin names we should try to resolve, and the resolvePlugin method just calls this helper and actually resolves them.
4 lines
139 B
JavaScript
4 lines
139 B
JavaScript
export default function getPossiblePluginNames(pluginName: string): Array<string> {
|
|
return [`babel-plugin-${pluginName}`, pluginName];
|
|
}
|