You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

broccoli-babel-transpiler

Package Overview
Dependencies
Maintainers
7
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-babel-transpiler

A Broccoli plugin which transpile ES6 to readable ES5 by using babel.

8.0.2
latest
Source
npmnpm
Version published
Weekly downloads
596K
-6.63%
Maintainers
7
Weekly downloads
 
Created

What is broccoli-babel-transpiler?

The 'broccoli-babel-transpiler' package is a Broccoli plugin that uses Babel to transpile JavaScript files. It allows you to use the latest JavaScript features by converting ES6/ES7+ code into a backward-compatible version of JavaScript that can run in older environments.

What are broccoli-babel-transpiler's main functionalities?

Basic Transpilation

This feature allows you to transpile ES6+ JavaScript code to ES5 using Babel. The code sample demonstrates how to set up a basic transpilation process with the '@babel/preset-env' preset.

const Babel = require('broccoli-babel-transpiler');
const inputNode = 'src';
const outputNode = new Babel(inputNode, {
  presets: ['@babel/preset-env']
});
module.exports = outputNode;

Custom Plugins

This feature allows you to use custom Babel plugins to transform your code. The code sample shows how to use the '@babel/plugin-transform-arrow-functions' plugin to transform arrow functions into regular functions.

const Babel = require('broccoli-babel-transpiler');
const inputNode = 'src';
const outputNode = new Babel(inputNode, {
  plugins: ['@babel/plugin-transform-arrow-functions']
});
module.exports = outputNode;

Source Maps

This feature enables the generation of source maps, which help in debugging by mapping the transpiled code back to the original source code. The code sample demonstrates how to enable inline source maps.

const Babel = require('broccoli-babel-transpiler');
const inputNode = 'src';
const outputNode = new Babel(inputNode, {
  sourceMaps: 'inline'
});
module.exports = outputNode;

Other packages similar to broccoli-babel-transpiler

Keywords

broccoli-plugin

FAQs

Package last updated on 01 Apr 2025

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