Skip to content

Mode option always overrides NODE_ENV at compile time. Why? #7470

@Can-Sahin

Description

@Can-Sahin

Bug report

What is the current behavior?

Setting mode option to none replaces process.env.NODE_ENV to string none in the bundled source code. So in every case (none, development, production) the bundled output will not have process.env.NODE_ENV anywhere but will have replaced strings. What is the reasoning behind this? Why can't I proceed with NODE_ENV variable and resolve within my applications logic

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

Setting option to none should not replace the process.env.NODE_ENV

Other relevant information:
webpack version: 4.10.2
Node.js version: 8.10
Operating System:
Additional tools:

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