@babel/plugin-transform-modules-commonjs

  • Version 8.1.2
  • Published
  • 14.7 kB
  • 2 dependencies
  • MIT license

Install

npm i @babel/plugin-transform-modules-commonjs
yarn add @babel/plugin-transform-modules-commonjs
pnpm add @babel/plugin-transform-modules-commonjs

Overview

This plugin transforms ES2015 modules to CommonJS

Index

Functions

function _default

_default: (
api: _babel_core.PluginAPI,
options: Options,
dirname: string
) => _babel_core.PluginObject<any>;

    function defineCommonJSHook

    defineCommonJSHook: (file: File, hook: CommonJSHook) => void;

      Interfaces

      interface Options

      interface Options extends PluginOptions {}

        property allowCommonJSExports

        allowCommonJSExports?: boolean;

          property allowTopLevelThis

          allowTopLevelThis?: boolean;

            property importInterop

            importInterop?: RewriteModuleStatementsAndPrepareHeaderOptions['importInterop'];

              property lazy

              lazy?: RewriteModuleStatementsAndPrepareHeaderOptions['lazy'];

                property loose

                loose?: boolean;
                • Deprecated

                  Use the constantReexports and enumerableModuleMeta assumptions instead.

                property mjsStrictNamespace

                mjsStrictNamespace?: boolean;

                  property noInterop

                  noInterop?: boolean;
                  • Deprecated

                    Use the importInterop instead.

                  property strict

                  strict?: boolean;

                    property strictMode

                    strictMode?: boolean;

                      property strictNamespace

                      strictNamespace?: boolean;

                        Package Files (1)

                        Dependencies (2)

                        Dev Dependencies (4)

                        Peer Dependencies (1)

                        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/@babel/plugin-transform-modules-commonjs.

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