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

Allow webpack/vite config to be async function #23302

Closed
lmiller1990 opened this issue Aug 11, 2022 · 3 comments · Fixed by #23605
Closed

Allow webpack/vite config to be async function #23302

lmiller1990 opened this issue Aug 11, 2022 · 3 comments · Fixed by #23605
Assignees
Labels
CT Issue related to component testing type: enhancement Requested enhancement of existing feature

Comments

@lmiller1990
Copy link
Contributor

What would you like?

Right now you can pass a webpack/vite config to component.devServer:

defineConfig({
  component: {
    devServer: {
      viteConfig: require('./vite.config.js')
    }
  }
})

It would help third parties integrate with Cypress if this could be an async function that receives the base Vite config as the first arg:

defineConfig({
  component: {
    devServer: {
      viteConfig: async (baseConfig) => {
        const newConfig = await something()
        return {...baseConfig, ...newConfig}
      })
    }
  }
})

Context: #22390 (comment)

Why is this needed?

It will help tools that want to ship pre-configured Cypress for Component Testing. Example: Quasar framework. Context: #22390 (comment)

Other

No response

@lmiller1990
Copy link
Contributor Author

Working on it... #23605

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 22, 2022

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 27, 2022

Released in 10.9.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.9.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CT Issue related to component testing type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants