-
-
Notifications
You must be signed in to change notification settings - Fork 372
Fix Babel options & Respect root's .babelrc
#153
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
Conversation
|
Oh. This is because we're picking up our own |
|
IMHO |
|
@lukeed actually it's because it's picking |
|
Right, the repo's It's doing what it's supposed to, we just have to ignore the root |
|
We could move our babel config into the package.json |
|
My 2 cents: Why don't we make a babel presets under |
|
@thangngoc89 I was going to suggest this too. Little more difficult since we have some conditional stuff, but should still be doable. Tests failed because sourcemaps grew as a result of embedded options. @rkostrzewski is on it 🙌 |
|
Woooooooooo |
rkostrzewski
left a comment
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.
@lukeed you're a star 🥇
|
@rkostrzewski no, you 🌟 Thanks for editing the how-to above 🙌 |
// preact.config.js
export default (config, env, helpers) => {
let { rule } = helpers.getLoadersByName(config, 'babel-loader');
rule.options.plugins.push('my-chosen-plugin');
};helpers.getLoadersByName(config, 'babel-loader') returns array. // preact.config.js
export default (config, env, helpers) => {
let { rule } = helpers.getLoadersByName(config, 'babel-loader')[0];
rule.options.plugins.push('my-chosen-plugin');
};Also change in examples at |
If the user defines a
.babelrcfile in their root directory, we will read it & overwrite our settings with what they've specified. This is a hard/forced reset that they may choose to use.Alternatively, a user may only want to modify the Babel configuration we've provided. Thanks to #56, they can do this now.
Fixes #152 & others that were bound to open 😆