diff --git a/.travis.yml b/.travis.yml index d7cb75d..07cfce7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,7 @@ cache: - ~/.npm node_js: - "9" - - "6" - - "4" + - "7.6" after_success: - npm run travis-deploy-once "npm run semantic-release" branches: diff --git a/index.js b/index.js index 3d6c2f9..7f0795e 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,13 @@ -var { inlineSource } = require('inline-source'), - PluginError = require('plugin-error'), - path = require('path'), - through = require('through2'); +'use strict'; + +const { inlineSource } = require('inline-source'); +const PluginError = require('plugin-error'); +const path = require('path'); +const through = require('through2'); const PLUGIN_NAME = 'gulp-inline-source'; function gulpInlineSource (options) { - 'use strict'; - return through.obj(function (file, enc, cb) { var self = this; diff --git a/package.json b/package.json index 756e835..37f7382 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "css", "javascript" ], + "engines": { + "node": ">=7.6" + }, "scripts": { "test": "tape test/*.js | faucet", "commit": "git-cz", diff --git a/test/main.js b/test/main.js index 950f365..141e038 100644 --- a/test/main.js +++ b/test/main.js @@ -1,10 +1,10 @@ 'use strict'; -var path = require('path'), - Vinyl = require('vinyl'), - fs = require('fs'), - test = require('tape'), - inlinesource = require('../'); +const path = require('path'); +const Vinyl = require('vinyl'); +const fs = require('fs'); +const test = require('tape'); +const inlinesource = require('../'); function getFile (filePath, contents) { return new Vinyl({ @@ -60,7 +60,7 @@ test('works with relative paths', function (t) { }); test('inlines assets without minification', function (t) { - var stream = inlinesource({ + const stream = inlinesource({ compress: false }); @@ -69,17 +69,17 @@ test('inlines assets without minification', function (t) { test('throws when trying to compress non-ES5 syntax', function (t) { t.plan(1); - - var stream = inlinesource({ compress: true }); - + + const stream = inlinesource({ compress: true }); + stream.on('error', function (err) { t.pass(); }); - + stream.on('finish', function () { t.end(); }); - + stream.write(getFixture('script-es6.html')); stream.end(); });