Skip to content

Commit

Permalink
fix: fix web modules resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 12, 2020
1 parent 893ae7b commit ce41994
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node/server/serverPluginModuleRewrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ export const resolveImport = (
if (bareImportRE.test(id)) {
// directly resolve bare module names to its entry path so that relative
// imports from it (including source map urls) can work correctly
const isWebModule = !!resolveWebModule(root, id)
return `/@modules/${
resolveWebModule(root, id) || resolveNodeModuleEntry(root, id) || id
isWebModule ? id : resolveNodeModuleEntry(root, id) || id
}`
} else {
let { pathname, query } = resolveRelativeRequest(importer, id)
Expand Down

0 comments on commit ce41994

Please sign in to comment.