Skip to content

Context: env: undefined #368

@Rouche

Description

@Rouche

Hello,

Details


I am trying to access env in webpack4 build but it seems to be undefined.
In webpack.config.js the variable is ok, but different from documentation. (process.env.WEBPACK_MODE instead of process.env.NODE_ENV)

Actually, none of the ctx properties have information about the webpack mode.

Error (Logs|Stacks)


console.log of the whole ctx object.

{ cwd: 'C:\\shared\\projects\\webpack-boilerplate\\webpack-multi-setup',
  env: undefined,
  ..... (lots of stuff)
}

Reproduction [Code]


https://github.com/Rouche/webpack-boilerplate/tree/master/webpack-multi-setup

Environment


Windows 10 Pro
npm 6.1.0

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