From 39efa88ab9ef16ca4dfdf8eed9d4f4fa3b81a42f Mon Sep 17 00:00:00 2001 From: ChaosEngine Date: Fri, 18 Oct 2024 22:17:36 +0200 Subject: [PATCH] gulp-header -> gulp-replace --- DotnetPlayground.Web/gulpfile.mjs | 6 ++++-- DotnetPlayground.Web/package.json | 2 +- DotnetPlayground.Web/wwwroot/css/site.css | 4 ++-- DotnetPlayground.Web/wwwroot/css/site.scss | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/DotnetPlayground.Web/gulpfile.mjs b/DotnetPlayground.Web/gulpfile.mjs index 288a1186..9713f1e8 100644 --- a/DotnetPlayground.Web/gulpfile.mjs +++ b/DotnetPlayground.Web/gulpfile.mjs @@ -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"; @@ -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)); }; diff --git a/DotnetPlayground.Web/package.json b/DotnetPlayground.Web/package.json index 18d55284..be421517 100644 --- a/DotnetPlayground.Web/package.json +++ b/DotnetPlayground.Web/package.json @@ -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", diff --git a/DotnetPlayground.Web/wwwroot/css/site.css b/DotnetPlayground.Web/wwwroot/css/site.css index f18368fd..bb44615b 100644 --- a/DotnetPlayground.Web/wwwroot/css/site.css +++ b/DotnetPlayground.Web/wwwroot/css/site.css @@ -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 { @@ -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***************/ diff --git a/DotnetPlayground.Web/wwwroot/css/site.scss b/DotnetPlayground.Web/wwwroot/css/site.scss index 77368602..77c80f4e 100644 --- a/DotnetPlayground.Web/wwwroot/css/site.scss +++ b/DotnetPlayground.Web/wwwroot/css/site.scss @@ -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 { @@ -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***************/