Skip to content

Commit

Permalink
fix: give empty list of systemJS dynamic import, if the moduleParam
Browse files Browse the repository at this point in the history
… wasn't found well
  • Loading branch information
Tal500 committed Oct 19, 2022
1 parent a722090 commit 6d4d82e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ export function parseImportsSystemJS(
code: string
): ReadonlyArray<ImportSpecifier> {
const moduleParam = analyzeSystemRegistration(code)?.moduleParam
if (!moduleParam) return []

const re =
/\((.+?(?<importDirective>\b\w+\.import\s*(?<parenthesesStart>\()\s*('(?<path1>.+?)'|"(?<path2>.+?)")\);?).*?),\s*"__VITE_PRELOAD__".*?\)/gs
Expand Down

0 comments on commit 6d4d82e

Please sign in to comment.