cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.47k stars 3.14k forks source link

Support webpack configuration of function type #17009

Open chenxsan opened 3 years ago

chenxsan commented 3 years ago

What would you like?

Currently, the @cypress/webpack-dev-server supports passing a webpackConfig argument, however only Record<string, any> type is supported. Namely, if I pass webpack configuration of function type like:

module.exports = (env) => ({
  module: { rules: [] }
})

It won't work.

Why is this needed?

I have a webpack configuration of function type https://github.com/chenxsan/mindmapping/blob/main/webpack.config.js and I want to reuse it for cypress component test. But it won't work at the moment so I have to manually copy some webpack configurations to the cypress/plugins/index.js.

See a reproducible branch here https://github.com/chenxsan/mindmapping/pull/11.

jennifer-shehane commented 5 months ago

Is this still an issue?