@rollup/plugin-babel

  • Version 6.0.4
  • Published
  • 52 kB
  • 2 dependencies
  • MIT license

Install

npm i @rollup/plugin-babel
yarn add @rollup/plugin-babel
pnpm add @rollup/plugin-babel

Overview

Seamless integration between Rollup and Babel.

Index

Functions

function babel

babel: (options?: RollupBabelInputPluginOptions) => Plugin;
  • A Rollup plugin for seamless integration between Rollup and Babel.

    Parameter options

    Plugin options.

    Returns

    Plugin instance.

function createBabelInputPluginFactory

createBabelInputPluginFactory: (
customCallback?: RollupBabelCustomInputPluginBuilder
) => typeof getBabelInputPlugin;

    function createBabelOutputPluginFactory

    createBabelOutputPluginFactory: (
    customCallback?: RollupBabelCustomOutputPluginBuilder
    ) => typeof getBabelOutputPlugin;

      function getBabelInputPlugin

      getBabelInputPlugin: (options?: RollupBabelInputPluginOptions) => Plugin;
      • A Rollup plugin for seamless integration between Rollup and Babel.

        Parameter options

        Plugin options.

        Returns

        Plugin instance.

      function getBabelOutputPlugin

      getBabelOutputPlugin: (options?: RollupBabelOutputPluginOptions) => Plugin;

        Interfaces

        interface RollupBabelCustomInputPlugin

        interface RollupBabelCustomInputPlugin {}

          property config

          config?: RollupBabelCustomInputPluginConfig;

            property options

            options?: RollupBabelCustomInputPluginOptions;

              property result

              result?: RollupBabelCustomInputPluginResult;

                interface RollupBabelCustomOutputPlugin

                interface RollupBabelCustomOutputPlugin {}

                  property config

                  config?: RollupBabelCustomOutputPluginConfig;

                    property options

                    options?: RollupBabelCustomOutputPluginOptions;

                      property result

                      result?: RollupBabelCustomOutputPluginResult;

                        interface RollupBabelCustomPluginConfigOptions

                        interface RollupBabelCustomPluginConfigOptions {}

                          property code

                          code: string;

                            property customOptions

                            customOptions: Record<string, any>;

                              interface RollupBabelCustomPluginResultOptions

                              interface RollupBabelCustomPluginResultOptions {}

                                property code

                                code: string;

                                  property config

                                  config: babelCore.PartialConfig;

                                    property customOptions

                                    customOptions: Record<string, any>;

                                      property transformOptions

                                      transformOptions: babelCore.TransformOptions;

                                        interface RollupBabelInputPluginOptions

                                        interface RollupBabelInputPluginOptions
                                        extends Omit<babelCore.TransformOptions, 'include' | 'exclude'> {}

                                          property babelHelpers

                                          babelHelpers?: 'bundled' | 'runtime' | 'inline' | 'external';
                                          • It is recommended to configure this option explicitly (even if with its default value) so an informed decision is taken on how those babel helpers are inserted into the code. 'bundled'

                                          property exclude

                                          exclude?: FilterPattern;
                                          • A picomatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. When relaying on Babel configuration files you can only exclude additional files with this option, you cannot override what you have configured for Babel itself. undefined;

                                          property extensions

                                          extensions?: string[];
                                          • An array of file extensions that Babel should transpile. If you want to transpile TypeScript files with this plugin it's essential to include .ts and .tsx in this option. ['.js', '.jsx', '.es6', '.es', '.mjs']

                                          property filter

                                          filter?: ReturnType<CreateFilter>;
                                          • Custom filter function can be used to determine whether or not certain modules should be operated upon. Example: import { createFilter } from '@rollup/pluginutils'; const include = 'include/**.js'; const exclude = 'exclude/**.js'; const filter = createFilter(include, exclude, {}); undefined;

                                          property include

                                          include?: FilterPattern;
                                          • A picomatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on. When relying on Babel configuration files you cannot include files already excluded there. undefined;

                                          property skipPreflightCheck

                                          skipPreflightCheck?: boolean;
                                          • Before transpiling your input files this plugin also transpile a short piece of code for each input file. This is used to validate some misconfiguration errors, but for sufficiently big projects it can slow your build times so if you are confident about your configuration then you might disable those checks with this option. false

                                          interface RollupBabelOutputPluginOptions

                                          interface RollupBabelOutputPluginOptions
                                          extends Omit<babelCore.TransformOptions, 'include' | 'exclude'> {}

                                            property allowAllFormats

                                            allowAllFormats?: boolean;
                                            • Use with other formats than UMD/IIFE. false

                                            Type Aliases

                                            type RollupBabelCustomInputPluginBuilder

                                            type RollupBabelCustomInputPluginBuilder = (
                                            babel: typeof babelCore
                                            ) => RollupBabelCustomInputPlugin;

                                              type RollupBabelCustomInputPluginConfig

                                              type RollupBabelCustomInputPluginConfig = (
                                              this: TransformPluginContext,
                                              cfg: babelCore.PartialConfig,
                                              options: RollupBabelCustomPluginConfigOptions
                                              ) => babelCore.TransformOptions;

                                                type RollupBabelCustomInputPluginOptions

                                                type RollupBabelCustomInputPluginOptions = (
                                                options: RollupBabelInputPluginOptions & Record<string, any>
                                                ) => {
                                                customOptions: Record<string, any>;
                                                pluginOptions: RollupBabelInputPluginOptions;
                                                };

                                                  type RollupBabelCustomInputPluginResult

                                                  type RollupBabelCustomInputPluginResult = (
                                                  this: TransformPluginContext,
                                                  result: babelCore.BabelFileResult,
                                                  options: RollupBabelCustomPluginResultOptions
                                                  ) => babelCore.BabelFileResult;

                                                    type RollupBabelCustomOutputPluginBuilder

                                                    type RollupBabelCustomOutputPluginBuilder = (
                                                    babel: typeof babelCore
                                                    ) => RollupBabelCustomOutputPlugin;

                                                      type RollupBabelCustomOutputPluginConfig

                                                      type RollupBabelCustomOutputPluginConfig = (
                                                      this: PluginContext,
                                                      cfg: babelCore.PartialConfig,
                                                      options: RollupBabelCustomPluginConfigOptions
                                                      ) => babelCore.TransformOptions;

                                                        type RollupBabelCustomOutputPluginOptions

                                                        type RollupBabelCustomOutputPluginOptions = (
                                                        options: RollupBabelOutputPluginOptions & Record<string, any>
                                                        ) => {
                                                        customOptions: Record<string, any>;
                                                        pluginOptions: RollupBabelOutputPluginOptions;
                                                        };

                                                          type RollupBabelCustomOutputPluginResult

                                                          type RollupBabelCustomOutputPluginResult = (
                                                          this: PluginContext,
                                                          result: babelCore.BabelFileResult,
                                                          options: RollupBabelCustomPluginResultOptions
                                                          ) => babelCore.BabelFileResult;

                                                            Package Files (1)

                                                            Dependencies (2)

                                                            Dev Dependencies (11)

                                                            Peer Dependencies (3)

                                                            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/@rollup/plugin-babel.

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