I am interested in using ECMAScript 6 features in my web application which I am developing using Visual Studio 2013. Currently the syntax does not seems to be working, How can I configure VS to make it work?
You can enable experimental ECMAScript features in your browser by going to chrome://flags/#enable-javascript-harmony and enabling the JavaScript Harmony flag. For some features, you may have to use Chrome Canary with the JavaScript Harmony flag enabled.
You can write JavaScript or TypeScript code in Visual Studio for many application types and services.
JavaScript ES6 (also known as ECMAScript 2015 or ECMAScript 6) is the newer version of JavaScript that was introduced in 2015. ECMAScript is the standard that JavaScript programming language uses. ECMAScript provides the specification on how JavaScript programming language should work.
If you have Resharper installed in your VS 2013 - from today on you can switch to using ES6:
What I've done for the past few years for my VS solutions is to have the latest version of node.js installed.
From there, I whould create an _buildscripts
directory with a package.json
file. (NOTE: make sure to set private:true
in your package.json)
With that in place I will have a prebuild.cmd (setup as a pre-build script for my project) with something similar to the following...
:CHANGE_TO_CURRENT_DIRECTORY rem Change to this batch file's drive/directory CD /D "%~dp0" :INSTALL NODE DEPENDENCIES AND INSTALL - use call, since it's a batch/cmd file call npm install :SET YOUR "start" SCRIPT IN package.json TO BE YOUR BUILD : such as .... "start":"gulp" call npm start
From here, you can setup gulp, traceur, browserify and/or another tools targeting newer javascript concepts.
I'm using git, so detecting new/updated files is far easier than with TFS, but you can script at least the checkout of your output directory for transpiled JavaScript.
You can also use something like watchify or gulp-watchify for hanling live edits (via a terminal window).
I realize this answer takes you well outside of VS's integrated tooling, there are some integrated tools, like chirpy and others that do these sorts of things, but my experience is they have be sub-par for my needs, and I've been doing more node development lately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With