Skip to content

Commit aee2ec8

Browse files
committed
replace uglify with babel-minify
1 parent 3f45725 commit aee2ec8

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎build-system/dist.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ gulp.task('dist:css', 'Compress css to dist.', () => {
3737
gulp.task('dist:js', 'Compress js to dist.', () => {
3838
return gulp.src(['./app/js/*.js'])
3939
.pipe(cachebust.references())
40-
.pipe($.if(['!./app/js/lib.js'], $.uglify()))
40+
.pipe($.minify())
4141
.pipe(cachebust.resources())
4242
.pipe(gulp.dest(distPath + '/js/'))
4343
.pipe($.size({title: 'dist:js'}));
@@ -73,7 +73,7 @@ gulp.task('dist:serviceworkers', function (cb) {
7373
.pipe($.replace(/_NETWORK_ONLY_/g, swConfig.networkOnly.join(',\n')))
7474
.pipe($.replace(/_CACHE_ONLY_/g, swConfig.cacheOnly.join(',\n')))
7575
.pipe($.replace(/_EXCLUDED_/g, swConfig.excluded.join(',\n')))
76-
.pipe($.uglifyEs.default())
76+
.pipe($.minify())
7777
.pipe(gulp.dest(distPath))
7878
.on('end', cb);
7979
});

‎build-system/util.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ util.util = {
1515
replace: replace
1616
};
1717

18+
util.minify = function (options) {
19+
return util.babelMinify(Object.assign({
20+
evaluate: false,
21+
builtIns: false
22+
}, options));
23+
};
24+
1825
module.exports = util;

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"fancy-log": "^1.3.3",
3636
"gulp": "^3.9.1",
3737
"gulp-autoprefixer": "^5.0.0",
38+
"gulp-babel-minify": "^0.5.0",
3839
"gulp-cachebust": "0.0.10",
3940
"gulp-cached": "^1.1.1",
4041
"gulp-concat": "^2.6.1",
@@ -49,8 +50,6 @@
4950
"gulp-sass": "^4.0.2",
5051
"gulp-sass-lint": "^1.4.0",
5152
"gulp-size": "^3.0.0",
52-
"gulp-uglify": "^3.0.1",
53-
"gulp-uglify-es": "^1.0.4",
5453
"gulp-watch": "^5.0.1",
5554
"imagemin-pngquant": "^6.0.1",
5655
"minimist": "^1.2.0",

0 commit comments

Comments
 (0)