mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-10 23:23:27 -05:00
ES6 has some nice new features. Specifically relevant to this piece of work are: Arrow functions[1], whose `this` context is bound the value of `this` in the current scope and can’t be overidden. The code is cleaner as a result, and doesn’t need the addition of a bind polyfill for older browsers. Template strings[2], which are similar to triple-quoted multi line strings in Python. This means less fiddly and error-prone string concatenation. This commit adds Babel[3] to the Gulp pipeline. This transpiles Javascript written to the ES6 specification into code which is compatible with older browsers that don’t understand ES6 syntax. It also rewrites the gulpfile itself using some ES6 syntax, for the same reasons. 1. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions 2. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings 3. https://babeljs.io
37 lines
1.0 KiB
JSON
37 lines
1.0 KiB
JSON
{
|
|
"name": "notifications-admin",
|
|
"version": "0.0.1",
|
|
"description": "Admin front end for GOV.UK Notify",
|
|
"engines": {
|
|
"node": "5.0.0"
|
|
},
|
|
"scripts": {
|
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
"postinstall": "./node_modules/bower/bin/bower install && npm run build",
|
|
"build": "./node_modules/gulp/bin/gulp.js",
|
|
"watch": "./node_modules/gulp/bin/gulp.js watch"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/alphagov/notifications-admin.git"
|
|
},
|
|
"author": "Government Digital Service",
|
|
"license": "MIT",
|
|
"homepage": "https://github.com/alphagov/notifications-admin#readme",
|
|
"dependencies": {
|
|
"babel-core": "6.3.26",
|
|
"babel-preset-es2015": "6.3.13",
|
|
"bower": "1.7.1",
|
|
"gulp": "3.9.0",
|
|
"gulp-add-src": "0.2.0",
|
|
"gulp-babel": "6.1.1",
|
|
"gulp-concat": "2.6.0",
|
|
"gulp-include": "2.1.0",
|
|
"gulp-jquery": "1.1.1",
|
|
"gulp-load-plugins": "1.1.0",
|
|
"gulp-sass": "2.1.1",
|
|
"gulp-uglify": "1.5.1",
|
|
"jquery": "1.11.2"
|
|
}
|
|
}
|