Skip to content

Commit

Permalink
fix: protect startServer from undefined specs
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed Aug 6, 2021
1 parent fe5ec3e commit 7b012b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion npm/vite-dev-server/src/startServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const resolveServerConfig = async ({ viteConfig, options }: StartDevServerOption
// Ask vite to pre-optimize all dependencies of the specs
finalConfig.optimizeDeps = finalConfig.optimizeDeps || {}

if (options.specs.length || supportFile) {
if ((options.specs && options.specs.length) || supportFile) {
finalConfig.optimizeDeps.entries = [...options.specs.map((spec) => spec.relative), supportFile]
}

Expand Down

0 comments on commit 7b012b2

Please sign in to comment.