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

Scripts: Add new flag to allow customization of the src directory. #39618

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/create-block/lib/init-package-json.js
Expand Up @@ -121,5 +121,25 @@ module.exports = async ( {
}
}
}
info( '' );
info(
'Installing npm devDependencies. It might take a couple of minutes...'
);
for ( const packageArg of npmDevDependencies ) {
try {
checkDependency( packageArg );
info( '' );
info( `Installing "${ packageArg }".` );
await command( `npm install ${ packageArg } --save-dev`, {
cwd,
} );
} catch ( { message } ) {
info( '' );
info(
`Skipping "${ packageArg }" npm dev dependency. Reason:`
);
error( message );
}
}
}
};
2 changes: 1 addition & 1 deletion packages/scripts/config/webpack.config.js
Expand Up @@ -232,7 +232,7 @@ const config = {
new CopyWebpackPlugin( {
patterns: [
{
from: copyWebPackPattens,
from: copyWebPackPatterns,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIt: it's webpack not WebPack 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Nice catch - I've updated the reference.

context: process.env.WP_SRC_DIRECTORY,
noErrorOnMissing: true,
},
Expand Down