Skip to content

Allow webpack/vite config to be async function #23302

Closed
@lmiller1990

Description

@lmiller1990

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

Metadata

Metadata

Assignees

Labels

CTIssue related to component testingtype: enhancementRequested enhancement of existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions