Skip to content

Commit

Permalink
fix(vite-dev-server): windows supportFile + preserve optimize entri…
Browse files Browse the repository at this point in the history
…es (#18286)

Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
  • Loading branch information
2 people authored and mjhenkes committed Jul 28, 2022
1 parent 055febd commit acceebf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions npm/vite-dev-server/src/startServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,21 @@ const resolveServerConfig = async ({ viteConfig, options }: StartDevServerOption
// Ask vite to pre-optimize all dependencies of the specs
finalConfig.optimizeDeps = finalConfig.optimizeDeps || {}

// pre-optimizea all the specs
// pre-optimize all the specs
if ((options.specs && options.specs.length)) {
finalConfig.optimizeDeps.entries = [...options.specs.map((spec) => spec.relative)]
// fix: we must preserve entries configured on target project
const existingOptimizeDepsEntries = finalConfig.optimizeDeps.entries

if (existingOptimizeDepsEntries) {
finalConfig.optimizeDeps.entries = [...existingOptimizeDepsEntries, ...options.specs.map((spec) => spec.relative)]
} else {
finalConfig.optimizeDeps.entries = [...options.specs.map((spec) => spec.relative)]
}

// only optimize a supportFile is it is not false or undefined
if (supportFile) {
finalConfig.optimizeDeps.entries.push(supportFile)
// fix: on windows we need to replace backslashes with slashes
finalConfig.optimizeDeps.entries.push(supportFile.replace(/\\/g, '/'))
}
}

Expand Down

1 comment on commit acceebf

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on acceebf Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.6.0/circle-matth/fix/hang-investigation-acceebf2ebaaedd3abde9f73792add2cb9b215dd/cypress.tgz

Please sign in to comment.