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

@reboost/plugin-babel

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reboost/plugin-babel

Babel plugin for Reboost

  • 0.21.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-96.43%
Maintainers
1
Weekly downloads
 
Created
Source

npm license

Babel Plugin

Adds support for transforming JavaScript or TypeScript with Babel.

Usage

Setup

Install it using npm

npm i -D @reboost/plugin-babel

Install @babel/core, if not already installed

npm i @babel/core

Import it from the package

const { start } = require('reboost');
const BabelPlugin = require('@reboost/plugin-babel');

Add it to the plugins array

const { start } = require('reboost');
const BabelPlugin = require('@reboost/plugin-babel');

start({
  plugins: [
    BabelPlugin({
      // Options
    })
  ]
})

Options

Supports all Babel options.

Example

Speeding up the build by excluding node modules

You may not need babel transformations on node_modules files. You can simply exclude them by using UsePlugin. This will increase performance too.

const { start, builtInPlugins: { UsePlugin } } = require('reboost');
const BabelPlugin = require('@reboost/plugin-babel');

start({
  plugins: [
    UsePlugin({
      include: /.*/,
      exclude: /node_modules/,
      use: BabelPlugin()
    })
  ]
})

Transforming new features

NOTE: While developing (not production) your app you should not transform your JavaScript code to support extremely old browsers, you should transform just the new features or proposals.

const { start, builtInPlugins: { UsePlugin } } = require('reboost');
const BabelPlugin = require('@reboost/plugin-babel');

start({
  plugins: [
    UsePlugin({
      include: /.*/,
      exclude: /node_modules/,
      use: BabelPlugin({
        plugins: [
          // Your babel plugin,
          // for example
          ['@babel/plugin-proposal-pipeline-operator', { proposal: 'smart' }]
        ]
      })
    })
  ]
})

License

Licensed under the MIT License.

Keywords

FAQs

Package last updated on 25 Sep 2021

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