Skip to content

Commit

Permalink
[skip ci]: Bump webpack-cli from 4.2.0 to 4.5.0 (#3447)
Browse files Browse the repository at this point in the history
* [skip ci]: Bump webpack-cli from 4.2.0 to 4.5.0

Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.2.0 to 4.5.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.2.0...webpack-cli@4.5.0)

Signed-off-by: dependabot[bot] <support@github.com>

* filter WEBPACK_* properties from env

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Jenkinson <tom@tjenkinson.me>
Co-authored-by: Tom Jenkinson <tjenkinson@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 8, 2021
1 parent 9fe5ce2 commit e7a7615
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 99 deletions.
157 changes: 62 additions & 95 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions webpack.config.js
Expand Up @@ -272,20 +272,22 @@ const multiConfig = [

// webpack matches the --env arguments to a string; for example, --env.debug.min translates to { debug: true, min: true }
module.exports = (envArgs) => {
const requestedConfigs = Object.keys(envArgs).filter(
(key) => !/^WEBPACK_/.test(key)
);
let configs;
if (!envArgs) {
if (!requestedConfigs.length) {
// If no arguments are specified, return every configuration
configs = multiConfig;
} else {
const enabledConfigNames = Object.keys(envArgs);
// Filter out enabled configs
const enabledConfigs = multiConfig.filter((config) =>
enabledConfigNames.includes(config.name)
requestedConfigs.includes(config.name)
);
if (!enabledConfigs.length) {
throw new Error(
`Couldn't find a valid config with the names ${JSON.stringify(
enabledConfigNames
requestedConfigs
)}. Known configs are: ${multiConfig
.map((config) => config.name)
.join(', ')}`
Expand Down

0 comments on commit e7a7615

Please sign in to comment.