Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

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

@AlejandroFlorin

Description

@AlejandroFlorin

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
                });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions