Copy published build into /published folder so we can do diffs on future changes

This commit is contained in:
Jocelyn Badgley (Twipped) 2020-10-12 15:16:55 -07:00
parent 4889ee81d0
commit a9b416f7bd
3 changed files with 13 additions and 1 deletions

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ node_modules
/analytics/RAW/*
/analytics/combined.log
/assets.json
/published

View File

@ -11,3 +11,8 @@ exports.dev = function cleanDistributionForDev () {
return src([ 'dist/**.{js|json|jsx}', 'rev-manifest.json', 'pages.json', 'assets.json' ], { read: false, allowEmpty: true })
.pipe(clean());
};
exports.prodBackup = function cleanProdCopy () {
return src([ 'published' ], { read: false, allowEmpty: true })
.pipe(clean());
};

View File

@ -1,5 +1,5 @@
const { series, watch } = require('gulp');
const { series, watch, src, dest } = require('gulp');
/** **************************************************************************************************************** **/
@ -26,6 +26,10 @@ exports.cloudfront = cloudfront;
exports.new = require('../build/new-post.js');
function copyProd () {
return src('dist/**/*').pipe(dest('published'));
}
/** **************************************************************************************************************** **/
exports.dev = series(devBuildTask);
@ -34,6 +38,8 @@ exports.publish = series(
cleanTask,
prodBuildTask,
pushToProd,
cleanTask.prodBackup,
copyProd,
cloudfront.prod,
);
exports.testpush = pushToProd.dryrun;