@@ -8,10 +8,9 @@ import { markdownConfigDefaults } from '@astrojs/markdown-remark';
8
8
import { bundledThemes , type BuiltinTheme } from 'shikiji' ;
9
9
import type { AstroUserConfig , ViteUserConfig } from '../../@types/astro.js' ;
10
10
11
- import fs from 'node:fs' ;
12
11
import type { OutgoingHttpHeaders } from 'node:http' ;
13
12
import path from 'node:path' ;
14
- import { fileURLToPath , pathToFileURL } from 'node:url' ;
13
+ import { pathToFileURL } from 'node:url' ;
15
14
import { z } from 'zod' ;
16
15
import { appendForwardSlash , prependForwardSlash , removeTrailingForwardSlash } from '../path.js' ;
17
16
@@ -238,25 +237,6 @@ export const AstroConfigSchema = z.object({
238
237
for ( const lang of langs ) {
239
238
// shiki -> shikiji compat
240
239
if ( typeof lang === 'object' ) {
241
- // shikiji does not support `path`
242
- // https://github.com/shikijs/shiki/blob/facb6ff37996129626f8066a5dccb4608e45f649/packages/shiki/src/loader.ts#L98
243
- const langPath = ( lang as any ) . path ;
244
- if ( langPath ) {
245
- // shiki resolves path from within its package directory :shrug:
246
- const astroRoot = fileURLToPath ( new URL ( '../../../' , import . meta. url ) ) ;
247
- const normalizedPath = path . isAbsolute ( langPath )
248
- ? langPath
249
- : path . resolve ( astroRoot , langPath ) ;
250
- try {
251
- const content = fs . readFileSync ( normalizedPath , 'utf-8' ) ;
252
- const parsed = JSON . parse ( content ) ;
253
- Object . assign ( lang , parsed ) ;
254
- } catch ( e ) {
255
- throw new Error ( `Unable to find language file at ${ normalizedPath } ` , {
256
- cause : e ,
257
- } ) ;
258
- }
259
- }
260
240
// `id` renamed to `name` (always override)
261
241
if ( ( lang as any ) . id ) {
262
242
lang . name = ( lang as any ) . id ;
0 commit comments