This commit is contained in:
2026-01-08 14:01:27 +08:00
parent 5190a0cc9c
commit 8e86f244c6
10 changed files with 25 additions and 32 deletions

View File

@@ -110,10 +110,11 @@ export default defineConfig({
rollupOptions: {
output: {
format: 'es',
// 确保 CSS 文件名可预测
// 确保 CSS 文件名固定,不带 hash
assetFileNames: (assetInfo) => {
if (assetInfo.name === 'style.css') {
return 'assets/style.css'
// CSS 文件使用固定名称,便于在 index.html 中引用
if (assetInfo.name?.endsWith('.css')) {
return 'assets/shared-styles.css'
}
return 'assets/[name]-[hash][extname]'
}