mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-25 03:03:16 +01:00
fix build error caused by ugify-js 3
This commit is contained in:
parent
dae3f9811d
commit
ee016e101d
@ -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'}))
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user