-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Allow to customize our babel configuration #466
Conversation
do expressions 😍 |
babel: function (config, { dev }) { | ||
// Add the stage-0 preset. | ||
// Make sure to use 'require.resolve' otherwise we won't be able to find it. | ||
config.presets.push(require.resolve('babel-preset-stage-0')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit too hacky to recommend. I wonder if the following works.
import presetStage0 from 'babel-preset-stage0'
...
config.presets.push(presetStage0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't import since it's next.config.js. It didn't work for me for simply giving the preset.
I will try more options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a pretty good option. I like it.
I thought we wanted to expose everything via next.config.js.
@rauchg what do you think?
Another idea: just use |
That's a pretty good option. I like it. @rauchg what do you think? |
@nkzawa, that sounds 😍 |
This works for both for all of the app pages including the custom document component.