Socket
Socket
Sign inDemoInstall

ember-cli-babel

Package Overview
Dependencies
5
Maintainers
5
Versions
154
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-babel

This Ember-CLI plugin uses [Babel](https://babeljs.io/) to allow you to use ES6 syntax with your Ember-CLI project.


Version published
Weekly downloads
690K
increased by15.13%
Maintainers
5
Install size
17.3 MB
Created
Weekly downloads
 

Package description

What is ember-cli-babel?

ember-cli-babel is an Ember CLI addon that provides Babel transpilation for Ember.js applications. It allows developers to use the latest JavaScript features by transpiling ES6+ code to ES5, ensuring compatibility with older browsers.

What are ember-cli-babel's main functionalities?

Transpile ES6+ to ES5

This feature allows you to transpile modern JavaScript (ES6+) to ES5, making your code compatible with older browsers. The code sample shows how to configure ember-cli-babel in an Ember CLI project to include the Babel polyfill.

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    'ember-cli-babel': {
      includePolyfill: true
    }
  });
  return app.toTree();
};

Custom Babel Plugins

You can add custom Babel plugins to your Ember CLI project. The code sample demonstrates how to include the '@babel/plugin-proposal-class-properties' plugin.

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      plugins: ['@babel/plugin-proposal-class-properties']
    }
  });
  return app.toTree();
};

Custom Babel Presets

This feature allows you to use custom Babel presets in your Ember CLI project. The code sample shows how to include the '@babel/preset-env' preset.

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      presets: ['@babel/preset-env']
    }
  });
  return app.toTree();
};

Other packages similar to ember-cli-babel

Changelog

Source

v5.1.10 (2016-08-15)

:rocket: Enhancement
  • #89 Fix issue with app.import being undefined. (@sandersky)
Committers: 1

Readme

Source

ember-cli-babel Build Status

This Ember-CLI plugin uses Babel to allow you to use ES6 syntax with your Ember-CLI project.

Installation

npm install --save-dev ember-cli-babel

Usage

This plugin should work without any configuration after installing. By default it will take every .js file in your project and run it through the Babel transpiler to convert the ES6 code to ES5. Running existing ES5 code through the transpiler shouldn't change the code at all (likely just a format change if it does).

If you need to customize the way that Babel transforms your code, you can do it by passing in any of the options found here. Example:

// Brocfile.js

var app = new EmberApp({
  babel: {
    // disable comments
    comments: false
  }
});

Polyfill

Babel comes with a polyfill that includes a custom regenerator runtime and core.js. Many transformations will work without it, but for full support you must include the polyfill in your app. The Babel feature tour includes a note for features that require the polyfill to work.

To include it in your app, pass includePolyfill: true in your babel options.

Features

Out of the box without a polyfill the following ES6 features are enabled:

FeatureSupported
Arrows and Lexical ThisYES
ClassesYES
Enhanced Object LiteralsYES
Template StringsYES
DestructuringYES
Default + Rest + SpreadYES
Let + ConstYES
Iterators + For..OfNO
GeneratorsNO
ComprehensionsYES
UnicodeYES
ModulesYES
Module LoadersNO
Map + Set + WeakMap + WeakSetNO
ProxiesNO
SymbolsNO
Subclassable Built-insPARTIAL
Math + Number + String + Object APIsNO
Binary and Octal LiteralsPARTIAL
PromisesNO
Reflect APINO
Tail CallsPARTIAL

See the Babel docs for more details

About Modules

Ember-CLI uses its own ES6 module transpiler for the custom Ember resolver that it uses. Because of that, this plugin disables Babel module compilation by blacklisting that transform. If you find that you want to use the Babel module transform instead of the Ember-CLI one, you'll have to explicitly set compileModules to true in your configuration. If compileModules is anything other than true, this plugin will leave the module syntax compilation up to Ember-CLI.

Keywords

FAQs

Last updated on 15 Aug 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc