From c4483d18648a4de1fff9a03a95bfec416c0f1be4 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Sat, 7 Dec 2019 15:41:56 +0000 Subject: [PATCH] Make the build reproducible (#6817) Whilst working on the Reproducible Builds effort [0] we noticed that Chart.js could not be built reproducibly. This is because it was embedding another build date in a "banner" comment. This patch uses the value from SOURCE_DATE_EPOCH [1] if present. This was originally filed in Debian as #946333 [2]. [0] https://reproducible-builds.org/ [1] https://reproducible-builds.org/specs/source-date-epoch/ [2] https://bugs.debian.org/946333 Signed-off-by: Chris Lamb --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index e8b593793..3cbfe0b5c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,7 +12,7 @@ const input = 'src/index.js'; const banner = `/*! * Chart.js v${pkg.version} * ${pkg.homepage} - * (c) ${new Date().getFullYear()} Chart.js Contributors + * (c) ${(new Date(process.env.SOURCE_DATE_EPOCH ? (process.env.SOURCE_DATE_EPOCH * 1000) : new Date().getTime())).getFullYear()} Chart.js Contributors * Released under the MIT License */`; -- 2.47.2