Skip to content

Webpack cli arguments and parameters configuration within webpack.config.js #540

@enigma1

Description

@enigma1

I wanted to have some additional control from within the webpack.config.js and preset some of the command line options as well as options that are not exposed inside the config.

Is it possible to have the options object passed to the configuration object and override the cli/defaults?

Seems the options are set in 2 files from what I examined bin/convert-argv.js and bin/webpack.js. For example I didn't want to exclude all the default modules from the compilation listing and yet have the array elements customized so I added a function in my config like this:

  var argsOutput = function(outputOptions) {
    outputOptions.exclude = ['node_modules', 'jam', 'components'];
    outputOptions.errorDetails = true;
  };

Then I call it from webpack.js and have some of the output options preset.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions