-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Expose resolved webpack config for external tool #4286
Copy link
Copy link
Closed
Labels
Description
What problem does this feature solve?
I am trying to add unit test with ava in this project. However, webpack alias is not understood by ava. This problem with ava could be resolved by providing a webpack config.
As of now, we need to create the webpack config by hand and try to match it with what nuxt is using.
If a resolved webpack config is produced and exposed, we could use this config with our testing, linting and other external tools.
Related to:
- Expose webpack config for ESLint #200
- webpack config for Jetbrains Webstorm #2936
- nuxt.config.js with ava #2170
What does the proposed changes look like?
Perhaps, it could look something similar to vue's cli-service implementation. Where the resolved webpack.config is exposed as a file.
https://cli.vuejs.org/guide/webpack.html#inspecting-the-project-s-webpack-config
For testing use case, perhaps:
- Developer call a function provided by nuxt to trigger the resolvation of webpack.config
- Nuxt expose the resolved webpack.config as a file
- Developer run test script which rely on the exposed webpack.config
For linting use case,
- Perhaps a base webpack.config can always be exposed as a file at the begining
- When developer call
nuxt dev, a new resolved webpack.config can override the existing webpack.config - IDE / Editor's eslint tool could automatically pick up this change and update its rule accordingly?
In summary,
- Expose a base webpack.config
- Resolve and update webpack.config as nuxt is building or via a function call by developer
- Developer / external tool make use of this resolved config
Reactions are currently unavailable