$ npm install gulp-babel-minify
npm install gulp-babel-minify --save-dev
const gulp = require("gulp");
const minify = require("gulp-babel-minify");
gulp.task("minify", () =>
gulp.src("./build/app.js")
.pipe(minify({
mangle: {
keepClassName: true
}
}))
.pipe(gulp.dest("./dist"));
);
gulpBabelMinify(minifyOptions, overrides);
These are passed on to the minify preset. Refer https://github.com/babel/minify/tree/master/packages/babel-preset-minify#options. Default {}
Default: {}
babel
: Use a custom @babel/core
minifyPreset
: Use a custom babel-preset-minify
comments
: [Function | RegExp | Boolean]© 2010 - cnpmjs.org x YWFE | Home | YWFE