Skip to content

Commit

Permalink
fix(resolve): node resolve from virtual modules
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 19, 2021
1 parent ca8442c commit c6d5ed8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
normalizePath,
fsPathFromId,
resolveFrom,
isDataUrl
isDataUrl,
cleanUrl
} from '../utils'
import { ResolvedConfig, ViteDevServer } from '..'
import slash from 'slash'
Expand Down Expand Up @@ -164,7 +165,9 @@ export function resolvePlugin(
if (
(res = tryNodeResolve(
id,
importer ? path.dirname(importer) : root,
importer && importer[0] === '/' && fs.existsSync(cleanUrl(importer))
? path.dirname(importer)
: root,
isProduction,
isBuild,
dedupe,
Expand Down

0 comments on commit c6d5ed8

Please sign in to comment.