Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@singlebrook/esbuild-plugin-babel

Babel plugin for esbuild. This fork supports Babel 8. We're not sure if it works with prior versions. The upstream version, while dated, works with Babel 7.


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 @singlebrook/esbuild-plugin-babel -D

Use

esbuild.config.js

import esbuild from 'esbuild';
import babel from '@singlebrook/esbuild-plugin-babel';

esbuild
    .build({
        entryPoints: ['index.js'],
        bundle: true,
        outfile: 'main.js',
        plugins: [babel()],
        // target: ['es5'] // if you target es5 with babel, add this option
    })
    .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-serve   →   Serve with live reload for esbuild.

esbuild-plugin-pipe   →   Pipe esbuild plugins output.

esbuild-plugin-svg   →   Svg files import plugin for esbuild.

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


About

Babel plugin for esbuild.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages