We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca8442c commit c6d5ed8Copy full SHA for c6d5ed8
packages/vite/src/node/plugins/resolve.ts
@@ -13,7 +13,8 @@ import {
13
normalizePath,
14
fsPathFromId,
15
resolveFrom,
16
- isDataUrl
+ isDataUrl,
17
+ cleanUrl
18
} from '../utils'
19
import { ResolvedConfig, ViteDevServer } from '..'
20
import slash from 'slash'
@@ -164,7 +165,9 @@ export function resolvePlugin(
164
165
if (
166
(res = tryNodeResolve(
167
id,
- importer ? path.dirname(importer) : root,
168
+ importer && importer[0] === '/' && fs.existsSync(cleanUrl(importer))
169
+ ? path.dirname(importer)
170
+ : root,
171
isProduction,
172
isBuild,
173
dedupe,
0 commit comments