Returns babel full plugin name if shorthand was used or the path provided
Fold.getNpmPluginNameOrPath(name)
Returns babel full plugin name if shorthand was used or the path provided
Parameters
-
name
{string}
The entry in the plugin array
Returns
{string}
Relative/absolute path to plugin or babel npm plugin name
If a babel plugin is on npm, it can be set in the plugins
array using
one of the following forms:
- full plugin name, e.g
"plugins": ["babel-plugin-myPlugin"]
- relative/absolute path, e.g:
"plugins": ["./node_modules/asdf/plugin"]
- using a shorthand, e.g:
"plugins": ["myPlugin"]
Since plugins are loaded through steal, we need to make sure the full
plugin name is passed to steal.import
so the npm extension can locate
the babel plugin. Relative/absolute paths should be loaded as any other
module.