add js/css cache busting by query string

This commit is contained in:
isUnknown 2025-10-08 12:41:07 +02:00
parent 33ec908a23
commit 3fc9d925e5
2 changed files with 7 additions and 2 deletions

View file

@ -88,3 +88,8 @@ tabs:
clientBriefImageTags:
label: Tags des images ajoutées aux briefs
type: tags
siteVersion:
label: Version du site
type: text
width: 1/4
disabled: true

View file

@ -25,8 +25,8 @@
<meta name="theme-color" content="#FFFFFF">
<?php if (Dir::exists('assets/dist')): ?>
<script type="module" src="<?= url('assets/dist/index.js') ?>" defer></script>
<link rel="stylesheet" href="<?= url('assets/dist/index.css') ?>">
<script type="module" src="<?= url('assets/dist/index.js') ?>?version=<?= page('projects')->siteVersion() ?>" defer></script>
<link rel="stylesheet" href="<?= url('assets/dist/index.css') ?>?version=<?= page('projects')->siteVersion() ?>">
<?php else: ?>
<script type="module" src="http://localhost:5173/@vite/client" defer></script>
<script type="module" src="http://localhost:5173/src/main.js" defer></script>