ES6 + Babel

  • Create a new Empty web site in VS 2015
  • Delete the web.config file
  • Create 2 folders – src, lib, add the following test1.js file to src:
       console.log("hello");
       var y = [1, 2, 3].map(n => n + 1);
       console.log(y);
    
  • Install node.js
  • On the node.js command prompt (in the project directory): o npm init
    # npm install --save-dev babel-cli
    # npm install babel-preset-es2015 --save-dev

     

  • Add the following command to the scripts section in package.json: o “build”:”babel src -d lib”
  • Create .babelrc file (note the leading dot)
  • {
    
    "presets": ["es2015"] 
    
    }

     

  •  
  • Test your work