clean up paths for server and server-dist, remove cors #96

This commit is contained in:
Matt Walsh
2025-06-02 20:59:35 -05:00
parent dc64e4bd7f
commit 974a061b44
7 changed files with 9 additions and 154 deletions

View File

@@ -137,6 +137,8 @@ const s3 = s3Upload({
const uploadSources = [
'dist/**',
'!dist/**/*.map',
'!dist/images/**/*',
'!dist/fonts/**/*',
];
const upload = () => src(uploadSources, { base: './dist', encoding: false })
.pipe(s3({
@@ -167,6 +169,9 @@ const uploadImages = () => src(imageSources, { base: './server', encoding: false
}),
);
const copyImageSources = () => src(imageSources, { base: './server', encoding: false })
.pipe(dest('./dist'));
const invalidate = () => cloudfront.send(new CreateInvalidationCommand({
DistributionId: process.env.DISTRIBUTION_ID,
InvalidationBatch: {
@@ -184,7 +189,7 @@ const buildPlaylist = async () => {
return file('playlist.json', JSON.stringify(playlist)).pipe(dest('./dist'));
};
const buildDist = series(clean, parallel(buildJs, compressJsData, compressJsVendor, copyCss, compressHtml, copyOtherFiles, buildPlaylist));
const buildDist = series(clean, parallel(buildJs, compressJsData, compressJsVendor, copyCss, compressHtml, copyOtherFiles, buildPlaylist, copyImageSources));
// upload_images could be in parallel with upload, but _images logs a lot and has little changes
// by running upload last the majority of the changes will be at the bottom of the log for easy viewing