各種アセットの出力ファイル名に Misskey 本体のバージョンを含めるようにする (MisskeyIO#305)

This commit is contained in:
riku6460 2023-12-30 00:18:03 +09:00 committed by GitHub
parent 769830c6de
commit 436ddb8fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View file

@ -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

View file

@ -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;

View file

@ -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,

View file

@ -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() {