gulp打包revReplace方法换回replace
This commit is contained in:
parent
f256740dcb
commit
a8f2a8c8b4
|
|
@ -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/`))
|
||||
}))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue