I have a project that uses babel, and I was curious if a .babelrc file is typically gitignored or not. I am using a couple of presets that are apart of the package.json file that I have in the .babelrc file so it seems like a .babelrc file should be in source control, but not totally sure.
The . babelrc file is your local configuration for your code in your project. Generally you would put it in the root of your application repo. It will affect all files that Babel processes that are in the same directory or in sibling directories of the .
babelrc file to the root of your project. This is the configuration file for Babel, and you'll use it to tell babel to use the plugin @babel/plugin-transform-arrow-functions when doing the transpliation. This plugin only transpiles ES6 arrow functions.
Babel has two parallel config file formats which can be used together, or independently. . babelrc would be useful if you want to run certain transformations / plugins on a subset of files /directories. Maybe you have 3rd party libraries that you don't want to be transformed/changed by babel.
tldr; you should not ignore it.
In case you have some codebase which can be compiled only under relevant babel configuration, you need to specify appropriate configuration for babel. So it becomes obvious that everyone who will run this project from scratch will need to have that pre-defined to run an application properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With