Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@cypress/vite-dev-server] Ability to select different port when running dev server #15892

Closed
michaelhays opened this issue Apr 8, 2021 · 2 comments · Fixed by #15893
Closed

Comments

@michaelhays
Copy link
Contributor

What would you like?

The ability to define a specific port in @cypress/vite-dev-server

Why is this needed?

I'm attempting to run component tests with a Vite dev server. Here's my plugin file:

const { startDevServer } = require('@cypress/vite-dev-server')

/**
 * @type {Cypress.PluginConfig}
 */
module.exports = (on, config) => {
  on('dev-server:start', (options) =>
    startDevServer({ options, viteConfig: { server: { port: 3001 } } }),
  )

  return config
}

However, when running npx cypress run-ct, server: { port: 3001 } is ignored because of this line.

I'll open a PR to add this.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 9, 2021

The code for this is done in cypress-io/cypress#15893, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@jennifer-shehane
Copy link
Member

This was released. Please update to the latest version of Cypress and @cypress/vite-dev-server.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants