I am trying to compile a simple file es6with babel CLI
Given the details below: what is going wrong?
$ node --version
v5.0.0
$ npm --version
3.3.6
$ npm init
$ npm install --save-dev babel-cli
$ echo -e 'import url from "url"\nconsole.log(`2+2=${2+2}`)' > script.js
$ ./node_modules/.bin/babel script.js
import url from "url";
console.log(`2+2=${ 2 + 2 }`);
In other words: I put ES6 and I exit ES6 (albeit with a slightly different spacing, and with a comma). I expect the import to be converted to the required one and that my back ticks disappear.
That is: I want ES5 out .
What do I need to do differently?
source
share