|
|
|
|
|
by kevan
3740 days ago
|
|
>It's unfortunate they don't have `npm install --save-dev babel babel-preset-es2015` and "write `{"presets":"es2015"}` to a new .babelrc file" smack-bang at the top of the homepage though. I think this would be a great first step towards making startup for new users less painful. Or maybe making an onboarding process similar to `npm init`, where the user is walked through a series of questions about what they need for their project and the initial .babelrc is generated automatically. |
|
npm install --save-dev babel-cli babel-preset-es2015
echo '{ "presets": ["es2015"] }' > .babelrc
echo "console.log(`1 + 1 = ${1 + 1}`);" > index.js
./node_modules/.bin/babel-node index.js.
I would link to http://babeljs.io/docs/usage/cli/ since users wouldn't get what babel-node vs babel is.
The init cli is certainly something we should do; I mentioned this in a comment below.(issue is https://phabricator.babeljs.io/T6956)