I'm trying a very simple test with the babel-cli
After installing it I made a file with the contents:
test.js
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
static distance(a, b) {
const dx = a.x - b.x;
const dy = a.y - b.y;
return Math.sqrt(dx*dx + dy*dy);
}
}
const p1 = new Point(5, 5);
const p2 = new Point(10, 10);
console.log(Point.distance(p1, p2));
Next I ran the command to transform it...
$ babel test.js
I expected to see the "transformed ES5" javascript, but it just spits out the exact same stuff, line for line, no transformation.
How do you use Babel to convert this into ES5 javascript code?