From a8f2a8c8b449dc73a1be42cb2cd9c353c17514b8 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 27 Dec 2024 13:47:05 +0800 Subject: [PATCH] =?UTF-8?q?gulp=E6=89=93=E5=8C=85revReplace=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=8D=A2=E5=9B=9Ereplace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 0033485..d048ef8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -32,14 +32,14 @@ gulp.task('create:versionCatalog', gulp.series('build', function () { // 替换${versionPath}/static/js/manifest.js window.SITE_CONFIG.cdnUrl占位变量 gulp.task('replace:cdnUrl', gulp.series('create:versionCatalog', function () { return gulp.src(`${versionPath}/static/js/manifest.js`) - .pipe($.revReplace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"')) + .pipe($.replace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"')) .pipe(gulp.dest(`${versionPath}/static/js/`)) })) // 替换${versionPath}/static/config/index-${env}.js window.SITE_CONFIG['version']配置变量 gulp.task('replace:version', gulp.series('create:versionCatalog', function () { return gulp.src(`${versionPath}/static/config/index-${env}.js`) - .pipe($.revReplace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`)) + .pipe($.replace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`)) .pipe(gulp.dest(`${versionPath}/static/config/`)) }))