mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-24 08:46:48 +08:00
A bit of DRYing in Gulpfile
This commit is contained in:
@@ -196,11 +196,7 @@ function buildCssPipeline(assetGroup, doConcat, doRebuild) {
|
||||
.pipe(postcss([
|
||||
autoprefixer({ browsers: ["last 2 versions"] })
|
||||
]))
|
||||
.pipe(header(
|
||||
"/*\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(header(getOutputFileHeader()))
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||
.pipe(eol())
|
||||
.pipe(rename(function (path) {
|
||||
@@ -239,11 +235,7 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
||||
.pipe(plumber())
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||
.pipe(typescript(typeScriptOptions)) // TypeScript doesn't support JavaScript modules.
|
||||
.pipe(header(
|
||||
"/*\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(header(getOutputFileHeader()))
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||
.pipe(eol())
|
||||
.pipe(rename(function (path) {
|
||||
@@ -261,3 +253,12 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
||||
}))
|
||||
.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