fix build error caused by ugify-js 3

This commit is contained in:
Matthias Kretschmann 2017-05-30 21:47:32 +02:00
parent dae3f9811d
commit ee016e101d
Signed by: m
GPG Key ID: BD3C1F3EDD7831FC
2 changed files with 8 additions and 2 deletions

View File

@ -13,6 +13,11 @@ import fs from 'fs'
import yaml from 'js-yaml'
import request from 'request'
// required to get our mix of old and ES6+ js to work with ugify-js 3
import uglifyjs from 'uglify-es'
import composer from 'gulp-uglify/composer'
const minify = composer(uglifyjs, console)
// get all the configs: `pkg` and `site`
import pkg from './package.json'
const site = yaml.safeLoad(fs.readFileSync('./_config.yml'))
@ -196,7 +201,7 @@ export const js = () =>
.pipe($.include({
includePaths: ['node_modules', SRC + '_assets/javascripts']
})).on('error', onError)
.pipe($.if(isProduction || isStaging, $.uglify())).on('error', onError)
.pipe($.if(isProduction || isStaging, minify())).on('error', onError)
.pipe($.if(!(isProduction || isStaging), $.sourcemaps.write()))
.pipe($.if(isProduction || isStaging, $.header(BANNER, { pkg: pkg })))
.pipe($.rename({suffix: '.min'}))

View File

@ -66,7 +66,8 @@
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.6",
"js-yaml": "^3.8.3",
"request": "^2.81.0"
"request": "^2.81.0",
"uglify-es": "^3.0.13"
},
"engines": {
"node": ">=7.0.0"