diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 2da74bdd90..ba7d775fbc 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -36,7 +36,7 @@ html link(rel='prefetch' href=infoImageUrl) link(rel='prefetch' href=notFoundImageUrl) //- https://github.com/misskey-dev/misskey/issues/9842 - link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.44.0') + link(rel='stylesheet' href=`/assets/tabler-icons.${version}/tabler-icons.min.css`) link(rel='modulepreload' href=`/vite/${clientEntry.file}`) if !config.clientManifestExists diff --git a/packages/frontend/src/scripts/code-highlighter.ts b/packages/frontend/src/scripts/code-highlighter.ts index 957669122e..bc5a75b5a1 100644 --- a/packages/frontend/src/scripts/code-highlighter.ts +++ b/packages/frontend/src/scripts/code-highlighter.ts @@ -1,7 +1,8 @@ import { setWasm, setCDN, Highlighter, getHighlighter as _getHighlighter } from 'shiki'; +import { version } from '@/config.js'; -setWasm('/assets/shiki/dist/onig.wasm'); -setCDN('/assets/shiki/'); +setWasm(`/assets/shiki.${version}/dist/onig.wasm`); +setCDN(`/assets/shiki.${version}/`); let _highlighter: Highlighter | null = null; diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts index a02aedf2f7..8859009f38 100644 --- a/packages/frontend/vite.config.ts +++ b/packages/frontend/vite.config.ts @@ -124,8 +124,9 @@ export function getConfig(): UserConfig { vue: ['vue'], photoswipe: ['photoswipe', 'photoswipe/lightbox', 'photoswipe/style.css'], }, - chunkFileNames: process.env.NODE_ENV === 'production' ? '[hash:8].js' : '[name]-[hash:8].js', - assetFileNames: process.env.NODE_ENV === 'production' ? '[hash:8][extname]' : '[name]-[hash:8][extname]', + entryFileNames: `${meta.version}.[hash].js`, + chunkFileNames: `${meta.version}.[hash].js`, + assetFileNames: `${meta.version}.[hash][extname]`, }, }, cssCodeSplit: true, diff --git a/scripts/build-assets.mjs b/scripts/build-assets.mjs index 289c9796c4..8ab917a0ad 100644 --- a/scripts/build-assets.mjs +++ b/scripts/build-assets.mjs @@ -20,7 +20,7 @@ async function copyFrontendFonts() { } async function copyFrontendTablerIcons() { - await fs.cp('./packages/frontend/node_modules/@tabler/icons-webfont', './built/_frontend_dist_/tabler-icons', { dereference: true, recursive: true }); + await fs.cp('./packages/frontend/node_modules/@tabler/icons-webfont', `./built/_frontend_dist_/tabler-icons.${meta.version}`, { dereference: true, recursive: true }); } async function copyFrontendLocales() { @@ -36,10 +36,10 @@ async function copyFrontendLocales() { } async function copyFrontendShikiAssets() { - await fs.cp('./packages/frontend/node_modules/shiki/dist', './built/_frontend_dist_/shiki/dist', { dereference: true, recursive: true }); - await fs.cp('./packages/frontend/node_modules/shiki/languages', './built/_frontend_dist_/shiki/languages', { dereference: true, recursive: true }); - await fs.cp('./packages/frontend/node_modules/aiscript-vscode/aiscript/syntaxes', './built/_frontend_dist_/shiki/languages', { dereference: true, recursive: true }); - await fs.cp('./packages/frontend/node_modules/shiki/themes', './built/_frontend_dist_/shiki/themes', { dereference: true, recursive: true }); + await fs.cp('./packages/frontend/node_modules/shiki/dist', `./built/_frontend_dist_/shiki.${meta.version}/dist`, { dereference: true, recursive: true }); + await fs.cp('./packages/frontend/node_modules/shiki/languages', `./built/_frontend_dist_/shiki.${meta.version}/languages`, { dereference: true, recursive: true }); + await fs.cp('./packages/frontend/node_modules/aiscript-vscode/aiscript/syntaxes', `./built/_frontend_dist_/shiki.${meta.version}/languages`, { dereference: true, recursive: true }); + await fs.cp('./packages/frontend/node_modules/shiki/themes', `./built/_frontend_dist_/shiki.${meta.version}/themes`, { dereference: true, recursive: true }); } async function copyBackendViews() {