Registry / devops / ember-cli-6to5

ember-cli-6to5

JSON →
library3.0.0jsnpmunverified

An Ember-CLI plugin that uses 6to5 (the precursor to Babel) to transpile ES6 syntax to ES5 for Ember-CLI projects. Version 3.0.0 is the latest stable release. This package is historical and has been superseded by ember-cli-babel. It blacklists the 6to5 module transform by default in favor of Ember-CLI's own ES6 module transpiler. Key differentiator: it was an early integration of 6to5/Babel into Ember-CLI, now obsolete.

npm install ember-cli-6to5
INSTALL
IMPORT
SIG · EMBER-CLI-6TO5
E
ember-cli-6to5
devopsjavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import Ember from 'ember'; // ES6 modules
var Ember = require('ember'); // CJS require, but Ember-CLI uses AMD
ember-cli-6to5 transpiles ES6 to ES5 but module syntax is handled by Ember-CLI's own transpiler; avoid mixing module systems.
config
// In Brocfile.js: var app = new EmberApp({ '6to5': { comments: false } });
// Attempting to configure in ES module syntax
Configuration is done via EmberApp options, not in ES module import.
compileModules
// In Brocfile.js: var app = new EmberApp({ '6to5': { compileModules: true } });
// Omitting compileModules and expecting 6to5 to handle modules
By default compileModules is false; set to true to let 6to5 handle module transpilation instead of Ember-CLI.

Installs ember-cli-6to5, configures it in Brocfile.js to disable comments, and shows usage of ES6 template literals and arrow functions in an Ember component.

// 1. Install npm install --save-dev ember-cli-6to5 // 2. Configure in Brocfile.js var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp({ '6to5': { // Disable comments for smaller output comments: false } }); // 3. Use ES6 features in your Ember app // app/components/my-component.js import Ember from 'ember'; export default Ember.Component.extend({ didInsertElement() { let message = `Hello from ES6!`; console.log(message); } }); module.exports = app.toTree();
Debug
Known issues
deprecatedember-cli-6to5 is deprecated; use ember-cli-babel instead.
fix
Run 'npm uninstall --save-dev ember-cli-6to5 && npm install --save-dev ember-cli-babel' and update Brocfile.js to use 'babel' instead of '6to5'.
affects: >=0.0.0
gotchaBy default, module compilation is disabled; 6to5 does not transpile ES6 modules. Ember-CLI's own module transpiler is used instead.
fix
Set compileModules: true in the 6to5 options to enable 6to5 module transpilation.
affects: >=3.0.0
gotchaThe package is named after 6to5, which was renamed to Babel. Ember-cli-6to5 only works with 6to5 v1.x, not with later Babel versions.
fix
Migrate to ember-cli-babel for compatibility with modern Babel.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module '6to5'
The package ember-cli-6to5 expects the '6to5' global, but if 6to5 is not installed or is version mismatched, the addon fails.
fix
Ensure 6to5 is installed: 'npm install --save-dev 6to5' or migrate to ember-cli-babel.
Error: 6to5 options must be an object. Received undefined
The configuration in Brocfile.js for the '6to5' key is missing or incorrectly placed.
fix
Configure 6to5 options within the EmberApp constructor as shown: var app = new EmberApp({ '6to5': { /* options */ } });
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
ember-cli-babelrequiredThis package is deprecated; ember-cli-babel is the current replacement.
Agent activity
4 hits · last 30 days
node
4
Resources
ember-cli-6to5 — npm install ember-cli-6to5 · libregistry