mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-24 16:53:10 +08:00
A bit of DRYing in Gulpfile
This commit is contained in:
@@ -196,11 +196,7 @@ function buildCssPipeline(assetGroup, doConcat, doRebuild) {
|
|||||||
.pipe(postcss([
|
.pipe(postcss([
|
||||||
autoprefixer({ browsers: ["last 2 versions"] })
|
autoprefixer({ browsers: ["last 2 versions"] })
|
||||||
]))
|
]))
|
||||||
.pipe(header(
|
.pipe(header(getOutputFileHeader()))
|
||||||
"/*\n" +
|
|
||||||
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
|
|
||||||
"** 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(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||||
.pipe(eol())
|
.pipe(eol())
|
||||||
.pipe(rename(function (path) {
|
.pipe(rename(function (path) {
|
||||||
@@ -239,11 +235,7 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
|||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||||
.pipe(typescript(typeScriptOptions)) // TypeScript doesn't support JavaScript modules.
|
.pipe(typescript(typeScriptOptions)) // TypeScript doesn't support JavaScript modules.
|
||||||
.pipe(header(
|
.pipe(header(getOutputFileHeader()))
|
||||||
"/*\n" +
|
|
||||||
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
|
|
||||||
"** 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(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||||
.pipe(eol())
|
.pipe(eol())
|
||||||
.pipe(rename(function (path) {
|
.pipe(rename(function (path) {
|
||||||
@@ -261,3 +253,12 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
|||||||
}))
|
}))
|
||||||
.pipe(gulp.dest(assetGroup.outputDir));
|
.pipe(gulp.dest(assetGroup.outputDir));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOutputFileHeader() {
|
||||||
|
return (
|
||||||
|
"/*\n" +
|
||||||
|
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
|
||||||
|
"** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp.\n" +
|
||||||
|
"*/\n\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user