Skip to content

Commit

Permalink
fix: remove preload markers in all cases
Browse files Browse the repository at this point in the history
fix #1694
  • Loading branch information
yyx990803 committed Jan 25, 2021
1 parent 6164794 commit 6cd2d35
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vite/src/node/plugins/importAnaysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,11 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
}
chunk.code = s.toString()
// TODO source map
} else {
// inlined dynamic import, remove the marker
chunk.code = code.replace(preloadMarkerRE, 'void 0')
}

// there may still be markers due to inlined dynamic imports, remove
// all the markers regardless
chunk.code = code.replace(preloadMarkerRE, 'void 0')
}
}
}
Expand Down

0 comments on commit 6cd2d35

Please sign in to comment.