Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teach build and start commands to use Webpack default if none is provided #13877

Merged
merged 15 commits into from
Mar 12, 2019
Prev Previous commit
Next Next commit
Always pass webpack CLI args to command
  • Loading branch information
oandregal committed Mar 11, 2019
commit 0c9362b821d87a573291aaf1cafa148c30d2e873
6 changes: 2 additions & 4 deletions packages/scripts/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ const hasWebpackConfig = () => hasCliArg( '--config' ) ||
hasProjectFile( 'webpack.config.babel.js' );

const getWebpackArgs = ( additionalArgs = [] ) => {
const webpackArgs = [];
if ( hasWebpackConfig() ) {
webpackArgs.push( ...getCliArgs() );
} else {
const webpackArgs = [ ...getCliArgs() ];
if ( ! hasWebpackConfig() ) {
webpackArgs.push( ...[ '--config', fromConfigRoot( 'webpack.config.js' ) ] );
}
webpackArgs.push( ...additionalArgs );
Expand Down