Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Babel cli - Passing nested options to

Tags:

babeljs

I don't want to need to use .babelrc file in all cases (build script) but can't seem to find a syntax to pass nested options to the CLI. Here is a simplified version of my .babelrc that I need to pass on the command line:

{"presets": [ ["es2015", { "modules": false }] ], "compact": true }

Anyone know the syntax for this?

like image 543
Jason Aden Avatar asked Feb 23 '17 20:02

Jason Aden


People also ask

Is Babel deprecated?

Well, as of Babel 7.4. 0, this powerful package had been deprecated. Composed of two dependent packages, core-js and regenerator-runtime , Babel now recommends installing them as dependencies and importing them at the top level of your application (think of index.

What is the Babelrc file?

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 .

Can the NPM view Babel cli versions command will display all the versions of Babel?

You can also check the version of babel-cli by finding the babel-cli folder in node_modules and looking at the version property of the package. json that is at the base of that folder. If babel-cli was installed globally via -g flag of npm install , you could check the version by executing command babel --version .


1 Answers

Babel does not currently support passing options to presets or plugins via the CLI.

like image 139
loganfsmyth Avatar answered Oct 09 '22 02:10

loganfsmyth