Merge pull request #83 from Moe-Sakura/dev

refactor: update PrismJS plugin in Vite configuration to use ESM import
This commit is contained in:
Asuna
2026-03-31 00:05:31 +08:00
committed by GitHub

View File

@@ -20,11 +20,11 @@ export default defineConfig({
plugins: [
{
name: 'prismjs-global-fix',
name: 'prismjs-esm-fix',
transform(code, id) {
if (id.includes('prismjs/components/') && !id.includes('prism-core')) {
return {
code: `var Prism = (typeof window !== 'undefined' ? window : globalThis).Prism;\n${code}`,
code: `import Prism from 'prismjs/components/prism-core';\n${code}`,
map: null,
}
}