Skip to content

Commit

Permalink
Change the logic to support = syntax for specifying output filenames.
Browse files Browse the repository at this point in the history
  • Loading branch information
pablinos committed Aug 29, 2021
1 parent 57e24c1 commit b0ae1fb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/scripts/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ const getWebpackArgs = () => {
// The following handles the support for multiple entry points in webpack, e.g.:
// `wp-scripts build one.js custom=./two.js` -> `webpack one=./one.js custom=./two.js`
webpackArgs = webpackArgs.reduce( ( args, cliArg ) => {
if (
getFileArgsFromCLI().includes( cliArg ) &&
! cliArg.includes( '=' )
) {
args.push( ...pathToEntry( cliArg ) );
} else {
if ( ! getFileArgsFromCLI().includes( cliArg ) ) {
args.push( cliArg );
return args;
}
if ( cliArg.includes( '=' ) ) {
args.push( '--env', 'entries.' + cliArg );
} else {
args.push( ...pathToEntry( cliArg ) );
}
return args;
}, [] );
Expand Down

0 comments on commit b0ae1fb

Please sign in to comment.