Is there a good reason why `.babelrc` at the top directory is not a default way to customize `babel-loader` config?
See original GitHub issueI mean, that’s probably something that would be expected by many, wouldn’t it? Especially considering that react-app-rewire-eslint
enables .eslintrc
support. Well, at least that’s something I was confused about initially myself
The only related thing I found is #83 but that’s more about Jest config. And it just seems weird to have it partially supported in some places but not the others and having to duplicate the same configuration options in two different places
What I’d like to propose is adding another function to the main package that would simillarly to injectBabelPlugin
locate rules using babel-loader
and switch babelrc
option to true.
This way it will be both, explicit and backwards compatible
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Config Files - Babel.js
New in Babel 7.x, Babel has a concept of a "root" directory, which defaults to the current working directory. For project-wide configuration, Babel...
Read more >why do I have to put babel-presets inside .babelrc and ...
No, this is not the case. Specifying the presets in the webpack config will only affect webpack, everything else that uses babel (e.g....
Read more >Setting up Webpack, Babel and React from scratch, revisited
Let's create webpack.config.js in our project's root. ... Babel also has default config file which is .babelrc , so let's create it in...
Read more >Setting up a NodeJS/Express Application with Babel - Medium
Mainly, the reason for using the babel is to make use of JavaScript new features in the code base. we don't know whether...
Read more >babel-loader - webpack
Make sure you are transforming as few files as possible. Because you are probably matching /\.m?js$/ , you might be transforming the node_modules...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just don’t and have everything you need in
.babelrc
like everyone else?update: But I get your point. That said, if
babelrc: true
were to become a default in 2.0 I would prefer to not havebabel-preset-react-app
included in this “obscure” way and just have it specified in.babelrc
instead with minimalistic loader configurationThis will behave slightly weird and possibly differently for CRA and Jest if you do it like this. Please see “protip” part of my comment from two weeks ago
tl;dr: you want to replace whole
options
object instead of modifying it