-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Enable babelrc plugins with options array syntax #292
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
Enable babelrc plugins with options array syntax #292
Conversation
lib/utils/babel-config.js
Outdated
| plugins.forEach(plugin => { | ||
| normalizedConfig.plugins.push(resolvePlugin(plugin, directory, 'plugin')) | ||
| let normalizedPlugin | ||
| console.log(plugin, isArray(plugin)) |
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.
console.log slipped in
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.
my bad :)
|
LGTM, @benstepp? |
|
👍 Now that I'm looking at the whole range of options Babel let's you use, we should probably Object.assign the normalized plugins/presets with the user's .babelrc rather than just creating a new object. |
|
@jakubrohleder what do you think about @benstepp's idea? |
|
@KyleAMathews Sorry for late response I've had quite a busy weekend. I completely agree with @benstepp idea of using |
|
Yeah I needed it when supporting |
|
@jakubrohleder I'll still merge this PR then Ben's over it so you get the commit credit as this was your initiative after all. And no worries about the slow reply! We're all volunteers here :-) Thanks! |
|
@jakubrohleder @benstepp so... I might of merged things together wrong. I removed the stuff when merging in Ben's object-assign addition but now the babel config tests broke. Was I supposed to have left the above code in? |
|
Leave the above in (also the lodash import). It's the change that support the babel plugin configs.
|
|
Ok, thanks. Restored these changes in f77efe6 |
Recently I've been fiddling a lot with multiple approaches to styles. By accident I've discovered a small bug that this pull request is fixing.
Babel docs allows two type of plugin syntax: string or an array with options e.g.
The second syntax caused an error, as normalization casts array to string.