Skip minifying standalone (#9094)
Also remove unused dependency on uglify js. gulp-uglify uses its own version.
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
|
||||
const path = require("path");
|
||||
const pump = require("pump");
|
||||
const chalk = require("chalk");
|
||||
const through = require("through2");
|
||||
const gutil = require("gulp-util");
|
||||
const rename = require("gulp-rename");
|
||||
const RootMostResolvePlugin = require("webpack-dependency-suite")
|
||||
.RootMostResolvePlugin;
|
||||
@@ -94,6 +97,30 @@ function webpackBuild(opts) {
|
||||
});*/
|
||||
}
|
||||
|
||||
function logUglify() {
|
||||
return through.obj(function(file, enc, callback) {
|
||||
gutil.log(
|
||||
`Minifying '${chalk.cyan(
|
||||
path.relative(path.join(__dirname, ".."), file.path)
|
||||
)}'...`
|
||||
);
|
||||
callback(null, file);
|
||||
});
|
||||
}
|
||||
|
||||
function logNoUglify() {
|
||||
return through.obj(function(file, enc, callback) {
|
||||
gutil.log(
|
||||
chalk.yellow(
|
||||
`Skipped minification of '${chalk.cyan(
|
||||
path.relative(path.join(__dirname, ".."), file.path)
|
||||
)}' because not publishing`
|
||||
)
|
||||
);
|
||||
callback(null, file);
|
||||
});
|
||||
}
|
||||
|
||||
function registerStandalonePackageTask(
|
||||
gulp,
|
||||
name,
|
||||
@@ -116,8 +143,9 @@ function registerStandalonePackageTask(
|
||||
}),
|
||||
gulp.dest(standalonePath),
|
||||
].concat(
|
||||
// Minification is super slow, so we skip it in CI.
|
||||
process.env.CI ? [] : uglify(),
|
||||
// Minification is super slow, so we skip it unless we are publishing
|
||||
process.env.IS_PUBLISH ? logUglify() : logNoUglify(),
|
||||
process.env.IS_PUBLISH ? uglify() : [],
|
||||
rename({ extname: ".min.js" }),
|
||||
gulp.dest(standalonePath)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user