Merge pull request #3790 from strongloop/backport/babel-es6-to-es5
Backport/babel es6 to es5
This commit is contained in:
commit
490eced414
|
@ -67,11 +67,13 @@
|
||||||
"loopback-datasource-juggler": "^2.56.0"
|
"loopback-datasource-juggler": "^2.56.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babel-preset-es2015": "^6.24.1",
|
||||||
|
"babelify": "^7.3.0",
|
||||||
"bluebird": "^3.4.1",
|
"bluebird": "^3.4.1",
|
||||||
"browserify": "^13.1.0",
|
"browserify": "^13.1.0",
|
||||||
"chai": "^3.5.0",
|
"chai": "^3.5.0",
|
||||||
"es5-shim": "^4.1.0",
|
|
||||||
"coveralls": "^2.11.15",
|
"coveralls": "^2.11.15",
|
||||||
|
"es5-shim": "^4.1.0",
|
||||||
"express-session": "^1.14.0",
|
"express-session": "^1.14.0",
|
||||||
"grunt": "^1.0.1",
|
"grunt": "^1.0.1",
|
||||||
"grunt-browserify": "^5.0.0",
|
"grunt-browserify": "^5.0.0",
|
||||||
|
|
|
@ -102,7 +102,28 @@ module.exports = function(config) {
|
||||||
'passport',
|
'passport',
|
||||||
'passport-local',
|
'passport-local',
|
||||||
'superagent',
|
'superagent',
|
||||||
'supertest'
|
'supertest',
|
||||||
|
],
|
||||||
|
transform: [
|
||||||
|
['babelify', {
|
||||||
|
presets: [
|
||||||
|
['es2015', {
|
||||||
|
// Disable transform-es2015-modules-commonjs which adds
|
||||||
|
// "use strict" to all files, even those that don't work
|
||||||
|
// in strict mode
|
||||||
|
// (e.g. chai, loopback-datasource-juggler, etc.)
|
||||||
|
modules: false,
|
||||||
|
}],
|
||||||
|
],
|
||||||
|
// By default, browserify does not transform node_modules
|
||||||
|
// As a result, our dependencies like strong-remoting and juggler
|
||||||
|
// are kept in original ES6 form that does not work in PhantomJS
|
||||||
|
global: true,
|
||||||
|
// Prevent SyntaxError in strong-task-emitter:
|
||||||
|
// strong-task-emitter/lib/task.js (83:4):
|
||||||
|
// arguments is a reserved word in strict mode
|
||||||
|
ignore: /node_modules\/(strong-task-emitter)\//,
|
||||||
|
}],
|
||||||
],
|
],
|
||||||
// transform: ['coffeeify'],
|
// transform: ['coffeeify'],
|
||||||
debug: true,
|
debug: true,
|
||||||
|
@ -111,6 +132,6 @@ module.exports = function(config) {
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add browserify to preprocessors
|
// Add browserify to preprocessors
|
||||||
preprocessors: {'test/*': ['browserify']}
|
preprocessors: {'test/**/*.js': ['browserify']},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue