cache-bursting for stylesheets and fonts
adding `?version=…` makes sure browsers get the latest files, and it looks like they honour the caching headers we send back
This commit is contained in:
parent
717696c472
commit
6d1b1df1aa
2 changed files with 16 additions and 2 deletions
|
@ -35,6 +35,20 @@ async function copyFrontendFonts() {
|
|||
|
||||
async function copyFrontendTablerIcons() {
|
||||
await fs.cp('./packages/frontend/node_modules/@phosphor-icons/web/src', './built/_frontend_dist_/phosphor-icons', { dereference: true, recursive: true });
|
||||
|
||||
for (const file of [
|
||||
'./built/_frontend_dist_/phosphor-icons/bold/style.css',
|
||||
'./built/_frontend_dist_/phosphor-icons/duotone/style.css',
|
||||
'./built/_frontend_dist_/phosphor-icons/fill/style.css',
|
||||
'./built/_frontend_dist_/phosphor-icons/light/style.css',
|
||||
'./built/_frontend_dist_/phosphor-icons/regular/style.css',
|
||||
'./built/_frontend_dist_/phosphor-icons/thin/style.css',
|
||||
]) {
|
||||
let source = await fs.readFile(file, { encoding: 'utf-8' });
|
||||
source = source.replaceAll(/(url\(.+?Phosphor.+?\.(?:[a-zA-Z0-9]+))/g, `$1?version=${meta.version}`);
|
||||
await fs.writeFile(file, source);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function copyFrontendLocales() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue