• function
 

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

  1. 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:

  1. full plugin name, e.g "plugins": ["babel-plugin-myPlugin"]
  2. relative/absolute path, e.g: "plugins": ["./node_modules/asdf/plugin"]
  3. 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.

Help us improve StealJS by taking our community survey