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

Configurable opts for babel-preset-env + babel-plugin-transform-runtime #2991

Merged
merged 2 commits into from Oct 7, 2017
Merged

Configurable opts for babel-preset-env + babel-plugin-transform-runtime #2991

merged 2 commits into from Oct 7, 2017

Conversation

tmcw
Copy link
Contributor

@tmcw tmcw commented Sep 25, 2017

This adds preset-env and transform-runtime options to the
next/babel Babel preset, which are then passed through to those
presets and transforms. This allows configuration to keep next.js
from the default 'maximum' transform, and instead use built-in
implementations of globals, classes, async, and other commonly-supported
features.

Fixes #2989

This adds `preset-env` and `transform-runtime` options to the
`next/babel` Babel preset, which are then passed through to those
presets and transforms. This allows configuration to keep next.js
from the default 'maximum' transform, and instead use built-in
implementations of globals, classes, async, and other commonly-supported
features.

Fixes #2989
presets: [
[require.resolve('babel-preset-env'), {
[require.resolve('babel-preset-env'), Object.assign({}, opts['preset-env'], {
Copy link
Member

@timneutkens timneutkens Sep 26, 2017

Choose a reason for hiding this comment

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

Lets do this:

{modules: false, ...opts['preset-env']}

So that people don't forget to pass off the modules to webpack. I can totally see users make this mistake 😄, or well, you already made this mistake in the example. Nothing bad about good defaults 👌 And if the users want to override, that will just work totally fine 👌 👍 💯

Copy link
Contributor Author

@tmcw tmcw Oct 6, 2017

Choose a reason for hiding this comment

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

Ah - okay, yep!

Copy link
Contributor Author

@tmcw tmcw Oct 6, 2017

Choose a reason for hiding this comment

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

🤔 Hm, is my code not doing that, just using Object.assign instead of spread notation? I'll switch to spread notation, but I suspect this might already be correct.

Copy link
Member

@timneutkens timneutkens Oct 7, 2017

Choose a reason for hiding this comment

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

Oh, you're right, totally missed it 😅 Either way, changing it around allows the user to override it if they really want to 😄

Copy link
Member

@timneutkens timneutkens left a comment

This looks really good 😄 cc @arunoda

Copy link
Member

@timneutkens timneutkens left a comment

Going to merge this in, awesome work 🙌

@timneutkens timneutkens merged commit 559c252 into vercel:master Oct 7, 2017
1 of 3 checks passed
@lock
Copy link

@lock lock bot commented May 10, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants