Webpack 4 issue with Visual Studio 2017 .net core 2.0.7 #68

Closed
opened 2025-08-09 17:14:53 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @AlejandroFlorin on 5/11/2018

My project is based on the Angular template for VS 2017 .net core 2.0 (not the new 2.1 templates, yet).

I've upgraded my project to webpack 4. I have update the webpack.config files (main and vendor) to handle the changes and have tweaked the csproj file to use the new --mode parameter required by webpack 4. I can build and publish ok and can run both webpack configs (main and vendor) without problems.

However, when I launch the app in dev mode (CTRL-F5) and VS automatically re-runs webpack, I get a console warning that 'mode' option has not been set and it falls back to Production mode.

How to I make VS call the hot middleware webpack rebuild with the new --mode=development parameter?

Is it an option in startup.cs? Maybe an additional option here?

app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
                    HotModuleReplacement = true
                });
*Originally created by @AlejandroFlorin on 5/11/2018* My project is based on the Angular template for VS 2017 .net core 2.0 (not the new 2.1 templates, yet). I've upgraded my project to webpack 4. I have update the webpack.config files (main and vendor) to handle the changes and have tweaked the csproj file to use the new --mode parameter required by webpack 4. I can build and publish ok and can run both webpack configs (main and vendor) without problems. However, when I launch the app in dev mode (CTRL-F5) and VS automatically re-runs webpack, I get a console warning that 'mode' option has not been set and it falls back to Production mode. How to I make VS call the hot middleware webpack rebuild with the new --mode=development parameter? Is it an option in startup.cs? Maybe an additional option here? ``` app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true }); ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#68
No description provided.