esbuild-plugin-babel-neosh

0.1.2 • Public • Published

esbuild-plugin-babel

Babel plugin for esbuild.


First, check if esbuild supports the transform you need (it's faster).
If not, you can add the Babel plugin you need with this plugin.


Install

npm install esbuild-plugin-babel --save-dev

Use

esbuild.config.js

import esbuild from 'esbuild';
import babel from 'esbuild-plugin-babel';

esbuild
    .build({
        entryPoints: ['index.js'],
        bundle: true,
        outfile: 'main.js',
        plugins: [babel()]
    })
    .catch(() => process.exit(1));

package.json

{
    "type": "module",
    "scripts": {
        "start": "node esbuild.config.js"
    }
}

Configure

esbuild.config.js

babel({
    filter: /.*/,
    namespace: '',
    config: {} // babel config here or in babel.config.json
});

babel.config.json

{
    "sourceMaps": "inline",
    "presets": [...],
    "plugins": [...]
}

Check

esbuild-plugin-pipe   →   Pipe esbuild plugins output.

esbuild-plugin-postcss-literal   →   PostCSS tagged template literals plugin for esbuild.


/esbuild-plugin-babel-neosh/

    Package Sidebar

    Install

    npm i esbuild-plugin-babel-neosh

    Weekly Downloads

    3

    Version

    0.1.2

    License

    none

    Unpacked Size

    4.04 kB

    Total Files

    4

    Last publish

    Collaborators

    • neosh11