Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should the .babelrc file be gitignored?

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.

like image 349
httpNick Avatar asked Jun 09 '16 07:06

httpNick


People also ask

Where do I put .babelrc files?

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 .

What is the use of Babelrc file?

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.

Is Babelrc the same as Babel config?

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.


1 Answers

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.

like image 100
oleh.meleshko Avatar answered Oct 31 '22 19:10

oleh.meleshko