mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Added two new features to Gulpfile.js (see below).
- Added support for separating minified resources by folder instead of by .min suffix. - Added support for flattening the output directory structure of glob-based asset groups. - Fixed bug where non-minified .js output files were not EOL normalized.
This commit is contained in:
parent
987c608fa2
commit
100604e317
@ -163,10 +163,15 @@ function buildCssPipeline(assetGroup, doConcat, doRebuild) {
|
||||
zindex: false
|
||||
})
|
||||
]))
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(eol())
|
||||
.pipe(rename(function (path) {
|
||||
if (assetGroup.flatten)
|
||||
path.dirname = "";
|
||||
if (assetGroup.separateMinified)
|
||||
path.dirname += "/min";
|
||||
else
|
||||
path.basename += ".min";
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
var devStream = gulp.src(assetGroup.inputPaths) // Non-minified output, with source mapping.
|
||||
.pipe(gulpif(!doRebuild,
|
||||
@ -193,6 +198,10 @@ function buildCssPipeline(assetGroup, doConcat, doRebuild) {
|
||||
"*/\n\n"))
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||
.pipe(eol())
|
||||
.pipe(rename(function (path) {
|
||||
if (assetGroup.flatten)
|
||||
path.dirname = "";
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
return merge([minifiedStream, devStream]);
|
||||
}
|
||||
@ -229,11 +238,19 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
||||
"** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp.\n" +
|
||||
"*/\n\n"))
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||
.pipe(eol())
|
||||
.pipe(rename(function (path) {
|
||||
if (assetGroup.flatten)
|
||||
path.dirname = "";
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir))
|
||||
.pipe(uglify())
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(eol())
|
||||
.pipe(rename(function (path) {
|
||||
if (assetGroup.separateMinified)
|
||||
path.dirname += "/min";
|
||||
else
|
||||
path.basename += ".min";
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user