@tknf-labs/esbuild-plugin-babel
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-beta.1 • Public • Published

ESBuild Plugin Babel

A esbuild plugin to transpile code with Babel.

Created by TKNF LLC License npm npm



Installation

npm install --save-dev esbuild @babel/core @tknf-labs/esbuild-plugin-babel # npm
yarn add --D esbuild @babel/core @tknf-labs/esbuild-plugin-babel           # yarn
pnpm add --D esbuild @babel/core @tknf-labs/esbuild-plugin-babel           # pnpm

Usage

const esbuild = require('esbuild');
const babel = require('@tknf-labs/esbuild-plugin-babel');

esbuild.build({
  entryPoints: ['src/index.js'],
  bundle: true,
  outfile: 'dist/index.js',
  plugins: [
    babel({
      babelOptions: {
        presets: ['@babel/preset-env'],
      },
    }),
  ],
});

Options

BabelPluginOptions

Type: Omit<TransformOptions, 'configFile'>
Default: {}

Options to pass to Babel. // TransformOptions accepts a Babel options object, so please refer to the Babel documentation for more information.


BabelPluginOptions.configFile

type: string
default: undefined

Path to the Babel configuration file to use.

Supported file extensions:

  • .babelrc
  • .babelrc.json
  • .babelrc.js
  • .babelrc.cjs
  • .babelrc.mjs
  • .babelrc.ts
  • .babelrc.cts
  • .babelrc.mts
  • babel.config.js
  • babel.config.json
  • babel.config.cjs
  • babel.config.mjs
  • babel.config.ts
  • babel.config.cts
  • babel.config.mts

Changelog

View the changelog at CHANGELOG.md

Package Sidebar

Install

npm i @tknf-labs/esbuild-plugin-babel

Weekly Downloads

0

Version

0.1.0-beta.1

License

MIT

Unpacked Size

73.4 kB

Total Files

9

Last publish

Collaborators

  • mast1ff