Skip to content

Commit

Permalink
fix(moduleResolve): do not rewrite external imports
Browse files Browse the repository at this point in the history
fix #42
  • Loading branch information
yyx990803 committed May 4, 2020
1 parent 1782f83 commit dd7af0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/node/serverPluginModuleRewrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ function rewriteImports(
}
}
if (dynamicIndex === -1 || hasLiteralDynamicId) {
// do not rewrite external imports
if (/https?:\/\//.test(id)) {
return
}

let resolved
if (/^[^\/\.]/.test(id)) {
resolved = resolver.idToRequest(id) || `/@modules/${id}`
Expand Down

0 comments on commit dd7af0a

Please sign in to comment.