Skip to content

Commit

Permalink
chore: init imports var before use (#9569)
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho authored Aug 7, 2022
1 parent a206f16 commit 905b8eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
// dynamic import to constant json may get inlined.
if (chunk.type === 'chunk' && chunk.code.indexOf(preloadMarker) > -1) {
const code = chunk.code
let imports: ImportSpecifier[]
let imports: ImportSpecifier[] = []
try {
imports = parseImports(code)[0].filter((i) => i.d > -1)
} catch (e: any) {
Expand Down

0 comments on commit 905b8eb

Please sign in to comment.