Skip to content

Commit

Permalink
fix(optimizer): check qualified deps length after accounting for include
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 29, 2021
1 parent 3dd1187 commit 6a03813
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ export async function optimizeDeps(
)
}

const qualifiedIds = Object.keys(deps)

const include = config.optimizeDeps?.include
if (include) {
const resolve = config.createResolver({ asSrc: false })
Expand All @@ -156,6 +154,8 @@ export async function optimizeDeps(
}
}

const qualifiedIds = Object.keys(deps)

if (!qualifiedIds.length) {
writeFile(dataPath, JSON.stringify(data, null, 2))
log(`No dependencies to bundle. Skipping.\n\n\n`)
Expand Down

0 comments on commit 6a03813

Please sign in to comment.