Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-babel

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-babel

Seamless integration between Rollup and Babel.

  • 2.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

What is rollup-plugin-babel?

The rollup-plugin-babel package is a Rollup plugin that allows you to use Babel to transpile your JavaScript code. This is particularly useful for converting ES6+ code into a format that is compatible with older browsers or environments. The plugin integrates seamlessly with Rollup, making it easy to include Babel in your build process.

What are rollup-plugin-babel's main functionalities?

Transpile ES6+ Code

This feature allows you to transpile ES6+ code to ES5 using Babel. The code sample demonstrates how to set up Rollup with the Babel plugin to transpile code from the 'src/index.js' file and output it to 'dist/bundle.js'.

const babel = require('rollup-plugin-babel');

module.exports = {
  input: 'src/index.js',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    babel({
      exclude: 'node_modules/**'
    })
  ]
};

Custom Babel Configuration

This feature allows you to use a custom Babel configuration. The code sample shows how to specify Babel presets and plugins directly within the Rollup configuration.

const babel = require('rollup-plugin-babel');

module.exports = {
  input: 'src/index.js',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    babel({
      presets: ['@babel/preset-env'],
      plugins: ['@babel/plugin-transform-runtime']
    })
  ]
};

Exclude Specific Files or Directories

This feature allows you to exclude specific files or directories from being transpiled by Babel. The code sample demonstrates how to exclude all files in the 'node_modules' directory.

const babel = require('rollup-plugin-babel');

module.exports = {
  input: 'src/index.js',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    babel({
      exclude: 'node_modules/**'
    })
  ]
};

Other packages similar to rollup-plugin-babel

Keywords

FAQs

Package last updated on 30 Dec 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc