Skip to content

Commit

Permalink
chore: update type init (#10251)
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed Sep 26, 2022
1 parent fb6d8cb commit ed40a65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {

const start = performance.now()
await init
let imports: readonly ImportSpecifier[] = []
let exports: readonly ExportSpecifier[] = []
let imports!: readonly ImportSpecifier[]
let exports!: readonly ExportSpecifier[]
source = stripBomTag(source)
try {
;[imports, exports] = parseImports(source)
Expand Down
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 @@ -439,7 +439,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 ed40a65

Please sign in to comment.