File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1
1
import path from 'node:path'
2
2
import MagicString from 'magic-string'
3
3
import { stripLiteral } from 'strip-literal'
4
+ import { parseAst } from 'rollup/parseAst'
4
5
import type { Plugin } from '../plugin'
5
6
import type { ResolvedConfig } from '../config'
6
7
import type { ResolveFn } from '../'
@@ -12,7 +13,6 @@ import { preloadHelperId } from './importAnalysisBuild'
12
13
import type { InternalResolveOptions } from './resolve'
13
14
import { tryFsResolve } from './resolve'
14
15
import { hasViteIgnoreRE } from './importAnalysis'
15
-
16
16
/**
17
17
* Convert `new URL('./foo.png', import.meta.url)` to its resolved built URL
18
18
*
@@ -71,7 +71,7 @@ export function assetImportMetaUrlPlugin(config: ResolvedConfig): Plugin {
71
71
const queryString = hasQueryDelimiter
72
72
? rawUrl . slice ( queryDelimiterIndex , - 1 )
73
73
: ''
74
- const ast = this . parse ( pureUrl )
74
+ const ast = parseAst ( pureUrl )
75
75
const templateLiteral = ( ast as any ) . body [ 0 ] . expression
76
76
if ( templateLiteral . expressions . length ) {
77
77
const pattern = buildGlobPattern ( templateLiteral )
You can’t perform that action at this time.
0 commit comments