@tknf-labs/esbuild-plugin-babel
v0.1.0-beta.1
Published
A esbuild plugin to transpile code with Babel.
Downloads
1
Maintainers
Readme
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