ES6 build Environment
To create a build environment for javascript you can use many tools, IDEs, Editors. In this post I list required tools and where to find it.
1. Node.JS - install latest version
Update npm using:
npm install npm –g
2. Babel.js - create a new directory and run the following commands (using node command prompt or shell with configured path)
npm init
npm install --save-dev babel-cli
npm install babel-preset-es2015 --save-dev
create directories for src,lib
update the package.json file to add the build command run:
{
"name": "es2015",
"version": "1.0.0",
"description": "sample",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build":"babel src -d lib"
},
"keywords": [
"es2015"
],
"author": "liran",
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.22.2",
"babel-preset-es2015": "^6.22.0"
}
}
Add .babelrc file (note the leading dot) with the following:
{
"presets": ["es2015"]
}
To build the code run:
npm run build
Now you can see the result on the lib directory
Recent Stories
Top DiscoverSDK Experts


Compare Products
Select up to three two products to compare by clicking on the compare icon () of each product.
{{compareToolModel.Error}}
{{CommentsModel.TotalCount}} Comments
Your Comment