diff --git a/.travis.yml b/.travis.yml index d916c19b9b..3ec496d5cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: node_js node_js: -- '6' - '8' - '10' - 'node' diff --git a/gulpfile.js b/gulpfile.js index 6942242ce1..0ef0b2ef1c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,6 +6,7 @@ const header = require('gulp-header'); const concat = require('gulp-concat'); const replace = require('gulp-replace'); const pump = require('pump'); +const util = require('util'); const fs = require('fs'); const paths = { @@ -77,16 +78,10 @@ function build(cb) { `), concat('prism.js'), dest('./')], cb); } -/** - * @return {Promise} - */ async function componentsJsonToJs() { const data = await componentsPromise; const js = `var components = ${JSON.stringify(data)};\nif (typeof module !== 'undefined' && module.exports) { module.exports = components; }`; - // Node's `util.promisify()` requires Node 8+ - return new Promise((resolve, reject) => { - fs.writeFile(paths.componentsFileJS, js, err => err ? reject(err) : resolve()); - }); + return util.promisify(fs.writeFile)(paths.componentsFileJS, js); } function watchComponentsAndPlugins() {