Skip to content

Scripts: use default babel if none is found in project#14168

Merged
oandregal merged 19 commits intomasterfrom
add/babel-to-scripts
Mar 14, 2019
Merged

Scripts: use default babel if none is found in project#14168
oandregal merged 19 commits intomasterfrom
add/babel-to-scripts

Conversation

@oandregal
Copy link
Copy Markdown
Member

@oandregal oandregal commented Feb 28, 2019

Changes to make Webpack use the @wordpress/babel-preset-default babel config if none is found when running wp-scripts build/start.

Test

  • make sure you can build Gutenberg for development: npm run dev and that it works as expected.
  • make sure you can build Gutenberg for production: npm run build and that it works as expected.
  • external testbed using the default babel config Add/wp scripts babel oandregal/understanding-gutenberg#7

@oandregal oandregal changed the title Add/babel to scripts Scripts: use default babel if none is found in project Feb 28, 2019
@oandregal oandregal self-assigned this Feb 28, 2019
@oandregal oandregal added [Type] Build Tooling Issues or PRs related to build tooling [Tool] WP Scripts /packages/scripts labels Feb 28, 2019
Comment thread packages/scripts/config/webpack.config.js Outdated
Comment thread packages/babel-preset-default/index.js Outdated
@oandregal oandregal force-pushed the add/defaults-to-scripts-build branch from b9f6973 to 6da9e92 Compare March 11, 2019 12:15
@oandregal oandregal force-pushed the add/babel-to-scripts branch from 785c91c to debef90 Compare March 11, 2019 13:31
@oandregal oandregal changed the base branch from add/defaults-to-scripts-build to master March 12, 2019 12:18
@oandregal oandregal force-pushed the add/babel-to-scripts branch from debef90 to 01a10f8 Compare March 12, 2019 12:19
@oandregal oandregal marked this pull request as ready for review March 12, 2019 12:19
@oandregal oandregal requested a review from gziolo March 12, 2019 12:19
Comment thread bin/packages/get-babel-config.js
Comment thread bin/packages/build.js
Comment thread packages/babel-preset-default/index.js Outdated
Comment thread bin/packages/build.js
Comment thread packages/babel-preset-default/index.js
Comment thread packages/babel-preset-default/index.js
Comment thread packages/babel-preset-default/index.js
@oandregal oandregal force-pushed the add/babel-to-scripts branch 3 times, most recently from 2dcc4e0 to eb88287 Compare March 14, 2019 09:38
@oandregal oandregal requested a review from gziolo March 14, 2019 12:28
Comment thread packages/babel-preset-default/index.js Outdated
Comment thread test/unit/jest.config.json Outdated
Comment thread packages/scripts/config/webpack.config.js Outdated
@oandregal oandregal force-pushed the add/babel-to-scripts branch from dbbc04b to 72b4f7d Compare March 14, 2019 16:46

const hasBabelConfig = () =>
hasProjectFile( '.babelrc' ) ||
hasProjectFile( '.babelrc.js' ) ||
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch :)

Individual packages shouldn't have node_modules installed in
their local paths in a normal Gutenberg operation. Yet,
if you `cd packages/<packagename> && npm install` things start
going south - like tests not passing.
Copy link
Copy Markdown
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

I tested it very extensively and it all works perfectly fine. Thi is AMAZING. Outstanding work on making it all work!!!

🥇 💯 🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants