trivago/parallel-webpack

Support argv as second config param

Open

#79 aberto em 28 de fev. de 2018

Ver no GitHub
 (8 comments) (6 reactions) (0 assignees)JavaScript (108 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (1.486 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador