Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lukeaus/d7ccf1007a7c36966289940f38a52920 to your computer and use it in GitHub Desktop.
Save lukeaus/d7ccf1007a7c36966289940f38a52920 to your computer and use it in GitHub Desktop.
Get started in Visual Studio Code with Babel Quickly
// Terminal
npm init
npm install --save babel-cli babel-preset-env
// Visual Studio Code
// Tasks --> Configure Tasks
// tasks.json
{
"version": "0.1.0",
"command": "${workspaceRoot}/node_modules/.bin/babel-node",
"isShellCommand": true,
"showOutput": "always",
"tasks": [
{
"args": ["${fileBasename}"],
"taskName": "babel (run)",
"suppressTaskName": true,
"isBuildCommand": true,
"isBackground": false
}
]
}
// next steps
// 1. create your file.js
// 2. make sure it contains a console.log(‘boo') statement or nothing will appear
// 3. Task —> Run Task —> babel (run)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment