ember-cli-babel-plugin-helpers

  • Version 1.1.1
  • Published
  • 21.3 kB
  • No dependencies
  • MIT license

Install

npm i ember-cli-babel-plugin-helpers
yarn add ember-cli-babel-plugin-helpers
pnpm add ember-cli-babel-plugin-helpers

Overview

Utilities for managing installed Babel plugins in an Ember app or addon

Index

Functions

function addPlugin

addPlugin: (
config: ConfigurationTarget | BabelPluginConfig[],
plugin: BabelPluginConfig,
options?: AddPluginOptions
) => void;
  • Add a plugin to the Babel configuration for the given target.

    Parameter config

    An array of plugin configuration or an EmberApp or Addon instance for which the plugin should be set up

    Parameter plugin

    Configuration for the Babel plugin to add

    Parameter options

    Optional constraints around where the plugin should appear in the array

function findPlugin

findPlugin: (
config: ConfigurationTarget | BabelPluginConfig[],
plugin: string
) => BabelPluginConfig | undefined;
  • Locates the existing configuration, if any, for a given plugin.

    Parameter config

    An array of plugin configuration or an EmberApp or Addon instance whose configuration should be checked

    Parameter plugin

    The name of the plugin to be located

function hasPlugin

hasPlugin: (
config: BabelPluginConfig[] | ConfigurationTarget,
plugin: string
) => boolean;
  • Indicates whether the given plugin is already present in the target's configuration.

    Parameter config

    An array of plugin configuration or an EmberApp or Addon instance whose configuration should be checked

    Parameter plugin

    The name of the plugin to be located

Interfaces

interface AddPluginOptions

interface AddPluginOptions {}

    property after

    after?: string[];
    • Any plugins that the given one must appear *after* in the plugins array.

    property before

    before?: string[];
    • Any plugins that the given one must appear *before* in the plugins array.

    interface ConfigurationTarget

    interface ConfigurationTarget {}
    • A configuration target is typically an EmberApp or Addon instance, which may already have plugins configured or other options set.

    property options

    options?: {
    babel?: {
    plugins?: BabelPluginConfig[];
    };
    };

      Type Aliases

      type BabelPlugin

      type BabelPlugin =
      | string
      | {
      name?: string;
      };
      • A Babel plugin is typically specified as a string representing a module to be loaded, either a package name or a full path. It's also possible for the actual implementation to be supplied, in which case we check the value of a name field.

      type BabelPluginConfig

      type BabelPluginConfig = BabelPlugin | [BabelPlugin, unknown?, unknown?];
      • Configuration for a Babel plugin may be the bare plugin itself, or a tuple optionally containing configuration for the plugin and a possible unique identifier to allow for multiple instances of the same plugin.

      Package Files (1)

      Dependencies (0)

      No dependencies.

      Dev Dependencies (12)

      Peer Dependencies (0)

      No peer dependencies.

      Badge

      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ember-cli-babel-plugin-helpers.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ember-cli-babel-plugin-helpers)
      • HTML
        <a href="https://www.jsdocs.io/package/ember-cli-babel-plugin-helpers"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>