Skip to content

Commit

Permalink
gulp-header -> gulp-replace
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosEngine committed Oct 18, 2024
1 parent 2f9db2c commit 39efa88
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions DotnetPlayground.Web/gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass(dartSass);

import header from 'gulp-header';
import replace from 'gulp-replace';
import glob from "tiny-glob";
import concat from "gulp-concat";
import cleanCSS from "@aptuitiv/gulp-clean-css";
Expand Down Expand Up @@ -354,7 +354,9 @@ const processSCSS = function (sourcePattern, notPattern) {
const { colorTheme, projectVersion } = processInputArgs();

return gulp.src([sourcePattern, "!" + notPattern])
.pipe(header('$themeColor: ${color};\n$projectVersion: ${version};\n', { color: colorTheme, version: `'${projectVersion}'` }))
// .pipe(header('$themeColor: ${color};\n$projectVersion: ${version};\n', { color: colorTheme, version: `'${projectVersion}'` }))
.pipe(replace('$themeColor', colorTheme))
.pipe(replace('$projectVersion', `'${projectVersion}'`))
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(notPattern));
};
Expand Down
2 changes: 1 addition & 1 deletion DotnetPlayground.Web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"fs-extra": "11.2.0",
"gulp": "5.0.0",
"gulp-concat": "2.6.1",
"gulp-header": "2.0.9",
"gulp-replace": "1.1.4",
"gulp-rename": "2.0.0",
"gulp-sass": "5.1.0",
"gulp-sourcemaps": "3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions DotnetPlayground.Web/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ main.container > hr {
background-color: darkred;
}*/
.bg-my-theme {
background-color: darkslateblue; /*$themeColor is an injected variable on gulp build pipeline by gulp-sass, gulp-header */
background-color: darkslateblue; /* injected variable on gulp build pipeline by gulp-replace */
}

.navbar-dark .navbar-nav .nav-link {
Expand Down Expand Up @@ -93,7 +93,7 @@ footer.container > noscript {
}

#spVersion::after {
content: ", Debug: xx.yy.zz-ssss";
content: ", Debug: xx.yy.zz-ssss"; /* injected variable on gulp build pipeline by gulp-replace */
}

/***************VirtualScroll start***************/
Expand Down
4 changes: 2 additions & 2 deletions DotnetPlayground.Web/wwwroot/css/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ main.container > hr {
}*/

.bg-my-theme {
background-color: $themeColor; /*$themeColor is an injected variable on gulp build pipeline by gulp-sass, gulp-header */
background-color: $themeColor; /* injected variable on gulp build pipeline by gulp-replace */
}

.navbar-dark .navbar-nav .nav-link {
Expand Down Expand Up @@ -137,7 +137,7 @@ footer.container > noscript {
}

#spVersion::after {
content: $projectVersion /*$projectVersion is an injected variable on gulp build pipeline by gulp-sass, gulp-header */
content: $projectVersion; /* injected variable on gulp build pipeline by gulp-replace */
}

/***************VirtualScroll start***************/
Expand Down

0 comments on commit 39efa88

Please sign in to comment.