Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Documentation for --run-dev and --run-prod is confusing due to inconsistency #18

Closed
1 of 3 tasks
blaise-io opened this issue May 15, 2018 · 2 comments
Closed
1 of 3 tasks

Comments

@blaise-io
Copy link

  • Operating System: Mac OS
  • Node Version: 8.11.1
  • NPM Version: 5.8.0
  • webpack Version: 4.6.0
  • webpack-command Version: 0.1.0

This issue is for a:

  • bug
  • feature request
  • modification request

Code

CLI Command
  $ webpack --run-dev
  $ webpack --run-prod
webpack.config.js
const webpack = require('webpack')

module.exports = {
  context: __dirname + "/src",
  entry: "./index",
  output: {
    path: __dirname + "/dist",
    filename: "bundle.js"
  },
  module: {
    loaders: [
      {
        test: /\.js$/
      }
    ]
  }
}

Expected Behavior

  • --run-dev in the documentation includes that it sets --define process.env.NODE_ENV="development", to be consistent with the --run-prod documentation.

Or alternatively:

  • --run-dev in the documentation includes that it sets the mode to "development"
  • --run-prod in the documentation includes that it sets the mode to "production"
  • --run-prod in the documentation removes the --define process.env.NODE_ENV=... notion (as this done by Webpack, not by Webpack Command).
  • Optional: --mode in the documentation includes the --define process.env.NODE_ENV=... notion or includes a link to https://webpack.js.org/concepts/mode/

Actual Behavior

  • --run-dev and --run-prod in the documentation both don't mention Webpack mode
  • --run-dev doesn't mention --define process.env.NODE_ENV=... whereas --run-prod does
@shellscape
Copy link
Contributor

So is the base issue here that it was confusing the --run-dev didn't include the fact that it set NODE_ENV to development?

@blaise-io
Copy link
Author

Yes, but you could also document that it actually sets the mode, as Webpack defines the NODE_ENV, not webpack-command.

See #13 but you made me fill out an entire template ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants