Socket
Socket
Sign inDemoInstall

esbuild-plugin-babel-cjs

Package Overview
Dependencies
53
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    esbuild-plugin-babel-cjs

Babel plugin for esbuild (CJS compatible).


Version published
Maintainers
1
Created

Readme

Source

esbuild-plugin-babel-cjs

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-cjs -D

Use

esbuild.config.js

const esbuild = require('esbuild');
const babel = require('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

{
    "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.


Keywords

FAQs

Last updated on 07 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc