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

@rollup/plugin-babel

Package Overview
Dependencies
Maintainers
4
Versions
16
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.

  • 5.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created

What is @rollup/plugin-babel?

The @rollup/plugin-babel package is a plugin that integrates Babel with Rollup, allowing developers to use Babel to transpile their JavaScript code as part of the Rollup bundling process. This integration enables the use of the latest JavaScript features while maintaining compatibility with older browsers and environments.

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

Transpilation of ESNext to compatible JavaScript

This feature allows developers to write their code using the latest JavaScript syntax and features (ESNext), and then transpile it into a version of JavaScript that is compatible with older browsers or environments. The code sample demonstrates how to configure the @rollup/plugin-babel plugin in a Rollup configuration file.

import babel from '@rollup/plugin-babel';

export default {
  input: 'src/index.js',
  output: {
    file: 'bundle.js',
    format: 'cjs'
  },
  plugins: [
    babel({ babelHelpers: 'bundled' })
  ]
};

Integration with Babel presets and plugins

This feature allows for the use of Babel presets and plugins within the Rollup build process, enabling developers to further customize the transpilation process. The code sample shows how to include the '@babel/preset-env' preset and the '@babel/plugin-proposal-class-properties' plugin in the Rollup configuration.

import babel from '@rollup/plugin-babel';

export default {
  input: 'src/index.js',
  output: {
    file: 'bundle.js',
    format: 'cjs'
  },
  plugins: [
    babel({
      babelHelpers: 'bundled',
      presets: ['@babel/preset-env'],
      plugins: ['@babel/plugin-proposal-class-properties']
    })
  ]
};

Other packages similar to @rollup/plugin-babel

Keywords

FAQs

Package last updated on 22 Feb 2022

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