better 'version' numbers for staging site

This commit is contained in:
Matt Walsh
2026-04-08 23:34:10 -05:00
parent 71d52c0b72
commit d4f648f244

View File

@@ -19,6 +19,7 @@ import * as dartSass from 'sass';
import gulpSass from 'gulp-sass';
import sourceMaps from 'gulp-sourcemaps';
import OVERRIDES from '../src/overrides.mjs';
import { DateTime } from 'luxon';
// get cloudfront
import reader from '../src/playlist-reader.mjs';
@@ -110,10 +111,9 @@ const htmlSources = [
const packageJson = await readFile('package.json');
let { version } = JSON.parse(packageJson);
const previewVersion = async () => {
// generate a relatively unique timestamp for cache invalidation of the preview site
const now = new Date();
const msNow = now.getTime() % 1_000_000;
version = msNow.toString();
// generate a unique timestamp for cache invalidation of the preview site
const now = DateTime.utc();
version = now.toFormat('yyyyLLddHHmmss')
};
const compressHtml = async () => src(htmlSources)