trivago/parallel-webpack

Support argv as second config param

Open

#79 aperta il 28 feb 2018

Vedi su GitHub
 (8 commenti) (6 reazioni) (0 assegnatari)JavaScript (108 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (1486 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Explain the problem

Sometimes a developer wants to access webpacks internal command line options in his config.

Expected Behaviour

The config function should pass two params into the config function:

  • An environment as the first parameter. See the environment options CLI documentation for syntax examples.
  • An options map (argv) as the second parameter. This describes the options passed to webpack, with keys such as output-filename and optimize-minimize.

source

Actual Behaviour

parallel-webpack omits the second param (argv).

Provide your webpack config

module.exports = (env, argv) => {
     console.log('isEnvSet', !!env)
     console.log('isArgvSet', !!argv)
     return {}
}

Steps to reproduce

Use the config above and run:

parallel-webpack --config=webpack.config.js

Provide your Environment details

  • Node version: v9.1.0
  • Operating System: MacOS 10.13.3
  • webpack version: 3.11.0
  • parallel-webpack version: 2.3.0

Guida contributor