mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-20 19:03:25 +08:00
Updates to gulpfile.js
Removed comments and notify, as well as console.logs.
This commit is contained in:
@@ -13,29 +13,7 @@ var glob = require("glob"),
|
|||||||
uglify = require("gulp-uglify"),
|
uglify = require("gulp-uglify"),
|
||||||
rename = require("gulp-rename"),
|
rename = require("gulp-rename"),
|
||||||
concat = require("gulp-concat"),
|
concat = require("gulp-concat"),
|
||||||
header = require("gulp-header"),
|
header = require("gulp-header")
|
||||||
notify = require("gulp-notify")
|
|
||||||
|
|
||||||
/*
|
|
||||||
** GULP TASKS
|
|
||||||
---------------------------------------
|
|
||||||
Checks Themes, Modules, and Core directories for an Assets.json file.
|
|
||||||
Assets.json defines what Less, CSS, TypeScript, JS files should be processed by Gulp.
|
|
||||||
|
|
||||||
When defining your own Assets.json file, it should be saved in the root of module or theme project
|
|
||||||
|
|
||||||
Assets.json example:
|
|
||||||
Saved to /Modules/My.Custom.Module/Assets.json
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"inputs": [ "Less/master.less" ], //Specifies which files to process during the Build task
|
|
||||||
"output": "Styles/@.css", //When @ is specified, each file specified in "inputs" will be converted to [filename].css
|
|
||||||
"watch": ["Less/*.less"], //specifies which files to watch, use this when you have a master Less file that imports other Less files
|
|
||||||
"generateSourceMaps": true //Will include source maps in unminified version, defaults to 'true'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
"inputs" and "output" are required. All other properties are optional.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Incremental build (each asset group is built only if one or more inputs are newer than the output).
|
// Incremental build (each asset group is built only if one or more inputs are newer than the output).
|
||||||
gulp.task("build", function () {
|
gulp.task("build", function () {
|
||||||
@@ -120,12 +98,6 @@ function buildCssPipeline(assetGroup, doRebuild) {
|
|||||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||||
});
|
});
|
||||||
var doConcat = path.basename(assetGroup.outputFileName, ".css") !== "@";
|
var doConcat = path.basename(assetGroup.outputFileName, ".css") !== "@";
|
||||||
if (!doRebuild) {
|
|
||||||
console.log("CSS will only rebuild if less files specified in 'inputs' are newer.");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log("Force Rebuild is enabled, rebuilding all input files.");
|
|
||||||
}
|
|
||||||
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
|
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
|
||||||
return gulp.src(assetGroup.inputPaths)
|
return gulp.src(assetGroup.inputPaths)
|
||||||
.pipe(gulpif(!doRebuild,
|
.pipe(gulpif(!doRebuild,
|
||||||
@@ -153,8 +125,7 @@ function buildCssPipeline(assetGroup, doRebuild) {
|
|||||||
.pipe(rename({
|
.pipe(rename({
|
||||||
suffix: ".min"
|
suffix: ".min"
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest(assetGroup.outputDir))
|
.pipe(gulp.dest(assetGroup.outputDir));
|
||||||
.pipe(gulpif(doRebuild, notify("Rebuild complete"), notify("Build process complete")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildJsPipeline(assetGroup, doRebuild) {
|
function buildJsPipeline(assetGroup, doRebuild) {
|
||||||
|
Reference in New Issue
Block a user