Skip to content

Framework: Remove packages build from build, dev scripts#15226

Merged
aduth merged 8 commits intomasterfrom
update/webpack-skip-babel
May 30, 2019
Merged

Framework: Remove packages build from build, dev scripts#15226
aduth merged 8 commits intomasterfrom
update/webpack-skip-babel

Conversation

@aduth
Copy link
Copy Markdown
Member

@aduth aduth commented Apr 26, 2019

Previously: #15219
Related: #14560

This pull request seeks to update the Gutenberg-specific Webpack configuration to avoid running Babel as part of the Webpack build. As described at #15219 (comment), the files processed by Webpack are already transpiled by Babel as a step immediately prior. Including babel-loader is therefore redundant, wasted effort.

With this change, I'd measured approximately a 57% decrease in the time it takes to run npx wp-scripts build (~16.7s to 7.1s, measured using time).

Testing Instructions:

  1. Reset your repository using git clean -fdx (Warning: This will forcefully remove any uncommitted files)
  2. Run npm run build
  3. Verify that JavaScript outputs both in build/*/*.js and in packages/*/build/*.js are transpiled as expected by Babel (e.g. no ES2015 or JSX)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] WP Scripts /packages/scripts [Type] Build Tooling Issues or PRs related to build tooling [Type] Performance Related to performance efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants