From 457da6f23eaf4b03e2745729cd038f001205d8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Mon, 5 Aug 2024 17:14:19 +0200 Subject: [PATCH] :sparkles: Append timestamp to CSS import in storybook --- .gitignore | 3 ++- .../templates/preview-head.mustache} | 4 ++-- frontend/scripts/_helpers.js | 9 +++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) rename frontend/{.storybook/preview-head.html => resources/templates/preview-head.mustache} (51%) diff --git a/.gitignore b/.gitignore index caf638f38a..b0b2074d8d 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,8 @@ /deploy /docker/images/bundle* /exporter/target +/frontend/.storybook/preview-body.html +/frontend/.storybook/preview-head.html /frontend/cypress/fixtures/validuser.json /frontend/cypress/videos/*/ /frontend/cypress/videos/*/ @@ -68,7 +70,6 @@ /web clj-profiler/ node_modules -frontend/.storybook/preview-body.html /test-results/ /playwright-report/ /blob-report/ diff --git a/frontend/.storybook/preview-head.html b/frontend/resources/templates/preview-head.mustache similarity index 51% rename from frontend/.storybook/preview-head.html rename to frontend/resources/templates/preview-head.mustache index 9985b3804e..fdbcabf559 100644 --- a/frontend/.storybook/preview-head.html +++ b/frontend/resources/templates/preview-head.mustache @@ -1,4 +1,4 @@ - + \ No newline at end of file + diff --git a/frontend/scripts/_helpers.js b/frontend/scripts/_helpers.js index 34e7c00fd6..b8fbd0de55 100644 --- a/frontend/scripts/_helpers.js +++ b/frontend/scripts/_helpers.js @@ -404,6 +404,15 @@ async function generateTemplates() { ); await fs.writeFile("./.storybook/preview-body.html", content); + content = await renderTemplate( + "resources/templates/preview-head.mustache", + { + manifest: manifest, + }, + partials, + ); + await fs.writeFile("./.storybook/preview-head.html", content); + content = await renderTemplate("resources/templates/render.mustache", { manifest: manifest, translations: JSON.stringify(translations),