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

Add config hook for altering the actually used webpack config #29630

Open
axten opened this issue Jun 7, 2024 · 0 comments
Open

Add config hook for altering the actually used webpack config #29630

axten opened this issue Jun 7, 2024 · 0 comments
Labels
type: feature New feature that does not currently exist

Comments

@axten
Copy link

axten commented Jun 7, 2024

What would you like?

Hello!
Since I stumbled across the same problem described #25998 and it took me hours to understand cypress webpack config, I would like to suggest a simple solution for this (beside clarifying docs).

Use case

I wont to import a util function in my cypress test from a node_modules package, that is not transpiled to es5.
Another use case is to load json files from a node_modules package with translations.

Feature request

As many other tools like Cypress provide, it would be nice to have a simple way to modify the actually used webpack config.
API could look like this:

// cypress.config.js
export default defineConfig({
  configureWebpack: (webpackConfig) => {
    return webpackConfig;
  },
});

Very often, just a single change is needed so overriding the whole preprocessor is really cumbersome.

Why is this needed?

Currently, just a little change to webpack config forces the user to completely override the preprocessor and finding a way to replicate the default webpack config, which is not easy (see #25998)

Other

No response

@jennifer-shehane jennifer-shehane added the type: feature New feature that does not currently exist label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants