Skip to content

Instantly share code, notes, and snippets.

@pixelhandler
Created December 3, 2014 06:05
Show Gist options
  • Select an option

  • Save pixelhandler/e0d5a655d3e7f90e91df to your computer and use it in GitHub Desktop.

Select an option

Save pixelhandler/e0d5a655d3e7f90e91df to your computer and use it in GitHub Desktop.
ember-cli-es5-shim
/node_modules
npm-debug.log

ember-cli-es5-shim

This Ember CLI addon imports the es5-shim as a dependency for your for add/addon.

Installation / Usage

From within your Ember CLI application (must be >= 0.0.41), run the following:

npm install --save-dev ember-cli-es5-shim

You can now use ES5 syntax supported by es5-shim in your .js files.

For example you may choose to use function () {}.bind and expect that phantomjs won't error out when you execute your test runner (phatomjs does not support Function.bind out of the box.

References

'use strict';
var path = require('path');
module.exports = {
name: 'ember-cli-es5-shim',
included: function(app) {
this._super.included.apply(this, arguments);
var mods = 'node_modules';
var shim = path.join(mods, 'ember-cli-es5-shim', mods, 'es5-shim', 'es5-shim.js');
app.import(shim);
}
};
{
"name": "ember-cli-es5-shim",
"version": "0.1.0",
"desc": "This Ember CLI addon imports the es5-shim as a dependency for your for add/addon.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git://github.com/pixelhandler/ember-cli-es5-shim"
},
"bugs": {
"url": "https://github.com/pixelhandler/ember-cli-es5-shim/issues"
},
"homepage": "https://github.com/pixelhandler/ember-cli-es5-shim"
"engines": {
"node": ">= 0.10.0"
},
"author": "Bill Heaton <pixelhandler@gmail.com>",
"license": "MIT",
"keywords": [
"ember-addon",
"ember-cli-es5-shim",
"ember-cli",
"es5",
"shim"
],
"dependencies": {
"es5-shim": "^4.0.5"
}
}
@pixelhandler

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment