File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ declare module '@vue/compiler-sfc' {
20
20
}
21
21
}
22
22
23
- const __dirname = path . dirname ( new URL ( import . meta. url ) . pathname )
24
23
const debug = createDebug ( '@intlify/cli:utils' )
25
24
26
25
export type CustomBlockContentType = 'json' | 'json5' | 'yaml' | 'unknwon'
@@ -287,15 +286,12 @@ export async function getSFCParser(version: number): Promise<parseSFC | null> {
287
286
let parser : parseSFC | null = null
288
287
try {
289
288
if ( version === 3 ) {
290
- parser = (
291
- await import (
292
- path . resolve ( __dirname , '../node_modules' , '@vue/compiler-sfc' )
293
- ) . then ( _rDefault )
294
- ) . parse as parseSFC
289
+ parser = ( await import ( '@vue/compiler-sfc' ) . then ( _rDefault ) )
290
+ . parse as parseSFC
295
291
} else if ( version === 2 ) {
296
- const { parseComponent } = await import (
297
- path . resolve ( __dirname , '../node_modules' , 'vue-template-compiler' )
298
- ) . then ( _rDefault )
292
+ const { parseComponent } = await import ( 'vue-template-compiler' ) . then (
293
+ _rDefault
294
+ )
299
295
parser = ( source : string ) => {
300
296
const errors : SyntaxError [ ] = [ ]
301
297
const descriptor = parseComponent ( source )
You can’t perform that action at this time.
0 commit comments