Commit 5fad6542f1

5fad6542f1851b664346cc887fd6efe195706457

parent: caa7f04e70

Unsigned

taskylizard <75871323+taskylizard@users.noreply.github.com> · 2026-06-15 10:46 UTC

suppress the larp

Layout: unified · split

docs/.vitepress/configs/index.ts +25 −1
@@ -11,6 +11,7 @@ import {
11} from '@nolebase/vitepress-plugin-page-properties/vite' 11} from '@nolebase/vitepress-plugin-page-properties/vite'
12import { fileURLToPath, URL } from 'node:url' 12import { fileURLToPath, URL } from 'node:url'
13import UnoCSS from 'unocss/vite' 13import UnoCSS from 'unocss/vite'
14import { createLogger } from 'vite'
14import Devtools from 'vite-plugin-vue-devtools' 15import Devtools from 'vite-plugin-vue-devtools'
15import type { DefaultTheme, Plugin, UserConfig } from 'vitepress' 16import type { DefaultTheme, Plugin, UserConfig } from 'vitepress'
16import { hostname, sidebar, siteConfig } from './constants' 17import { hostname, sidebar, siteConfig } from './constants'
@@ -19,6 +20,25 @@ import { configureMarkdown } from './markdown'
19import { aliases, defs, movePlugin } from './markdown/emoji' 20import { aliases, defs, movePlugin } from './markdown/emoji'
20import { collectPageLinks, urlSearchDevPlugin, writeUrlSearchIndex } from '../plugins/urlSearchPlugin' 21import { collectPageLinks, urlSearchDevPlugin, writeUrlSearchIndex } from '../plugins/urlSearchPlugin'
21 22
23const logger = createLogger()
24const warn = logger.warn
25const warnOnce = logger.warnOnce
26
27function shouldSuppressWarning(message: string) {
28 return message.includes('[lightningcss minify] Unknown at rule: @property') ||
29 message.includes('Some chunks are larger than')
30}
31
32logger.warn = (message, options) => {
33 if (shouldSuppressWarning(message)) return
34 warn(message, options)
35}
36
37logger.warnOnce = (message, options) => {
38 if (shouldSuppressWarning(message)) return
39 warnOnce(message, options)
40}
41
22const GIT_COMMIT = process.env.NODE_ENV === 'development' 42const GIT_COMMIT = process.env.NODE_ENV === 'development'
23 ? 'dev' 43 ? 'dev'
24 : (process.env.GITHUB_SHA ?? 44 : (process.env.GITHUB_SHA ??
@@ -89,9 +109,13 @@ export const shared: UserConfig<DefaultTheme.Config> = {
89 } 109 }
90 }, 110 },
91 vite: { 111 vite: {
112 customLogger: logger,
92 experimental: { 113 experimental: {
93 enableNativePlugin: true 114 enableNativePlugin: true
94 }, 115 },
116 build: {
117 cssMinify: 'lightningcss'
118 },
95 optimizeDeps: { 119 optimizeDeps: {
96 exclude: [ 120 exclude: [
97 '@nolebase/vitepress-plugin-enhanced-readabilities/client', 121 '@nolebase/vitepress-plugin-enhanced-readabilities/client',
@@ -149,4 +173,4 @@ export const shared: UserConfig<DefaultTheme.Config> = {
149 ] 173 ]
150 } 174 }
151 } 175 }
152}\ No newline at end of file 176}
unocss.config.ts +2 −2
@@ -99,7 +99,7 @@ export default defineConfig({
99 'vertical-align': '-0.125em', // changed from 'middle' 99 'vertical-align': '-0.125em', // changed from 'middle'
100 'min-width': '1.2rem' 100 'min-width': '1.2rem'
101 }, 101 },
102 warn: true, 102 warn: false,
103 collections: { 103 collections: {
104 custom: FileSystemIconLoader(resolve(__dirname, 'docs/public/custom')), 104 custom: FileSystemIconLoader(resolve(__dirname, 'docs/public/custom')),
105 inline: customIcons 105 inline: customIcons
@@ -107,4 +107,4 @@ export default defineConfig({
107 }) 107 })
108 ], 108 ],
109 transformers: [transformerDirectives()] 109 transformers: [transformerDirectives()]
110})\ No newline at end of file 110})