What is .babelrc used for?

Note: I am no expert and I am just stating what I know and read online


.babelrc is the configuration file used for your babel


What is babel used for?

Babel is used to make sure the javascript in your website are all backward compatible. So older engine of javascript can be used to access your website, as well as modern javascript.


What is the difference between babel and package.json?

Babel is considered a library, while package.json is a file that describes the meta data of a project, as well as defining the functional attributes that include the dependencies included and scripts to be ran (for building the dev and production environment). You can use Babel by including Babel dependencies into package.json

Where should I create the .babelrc file?

1) .babelrc file can be created anywhere, preferrably within the same directory of package.json. 

2) You can use babel by specifying the `"babel": {}` within the package.json as well. [source] 

3)  If .babelrc file is not found anywhere, Babel will traverse up the directory to find the .babelrc file, or it finds the `"babel": {}` within the package.json.

Comments

Popular posts from this blog

Support for the experimental syntax 'decorators' isn't currently enabled (5:3):

How to add environment variables into Heroku container

Running CQL scripts in Cassandra