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

fix(webpack): support standard webpack config with @nx/webpack:dev-server #22660

Merged
merged 1 commit into from Apr 3, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Apr 3, 2024

This PR brings the standard webpack config behavior from @nx/webpack:webpack to @nx/webpack:dev-server. Previously, the dev-server executor only worked with our own withNx and other composable plugin functions. With the change from this PR, users can export a standard webpack configuration as shown in the new e2e test.

Current Behavior

Dev-server results in an error like:


 - configuration should be an object:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, extends?, externals?, externalsPresets?, externalsType?, ignoreWarnings?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, snapshot?, stats?, target?, watch?, watchOptions? }
   -> Options object as provided by the user.

ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration should be an object:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, extends?, externals?, externalsPresets?, externalsType?, ignoreWarnings?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, snapshot?, stats?, target?, watch?, watchOptions? }
   -> Options object as provided by the user.

Expected Behavior

Dev-server should work.

Related Issue(s)

Fixes #22288

@jaysoo jaysoo requested a review from a team as a code owner April 3, 2024 20:59
@jaysoo jaysoo requested a review from Coly010 April 3, 2024 20:59
Copy link

vercel bot commented Apr 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Apr 3, 2024 8:59pm

@ndcunningham ndcunningham merged commit 4fdf862 into master Apr 3, 2024
6 checks passed
@ndcunningham ndcunningham deleted the issue_22288 branch April 3, 2024 21:37
FrozenPandaz pushed a commit that referenced this pull request Apr 5, 2024
Copy link

github-actions bot commented Apr 9, 2024

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executor nx/webpack:dev-server broken on NX 18
2 participants