- CoffeeScript Application Development Cookbook
- Mike Hatfield
- 437字
- 2021-07-23 19:35:51
Configuring Visual Studio
In this recipe, we will demonstrate how to add CoffeeScript support to Visual Studio.
Getting ready
If you are on the Windows platform, you can use Microsoft's Visual Studio software. You can download Microsoft's free Express edition (Express 2013 for Web) from http://www.microsoft.com/express.
How to do it...
If you are a Visual Studio user, Version 2010 and above can work quite effectively with CoffeeScript through the use of Visual Studio extensions.
If you are doing any form of web development with Visual Studio, the Web Essentials extension is a must-have.
To install Web Essentials, perform the following steps:
- Launch Visual Studio.
- Click on the Tools menu and select the Extensions and Updates menu option. This will display the Extensions and Updates window (shown in the next screenshot).
- Select Online in the tree on the left-hand side to display the most popular downloads.
- Select Web Essentials 2012 from the list of available packages and then click on the Download button. This will download the package and install it automatically.
- Once the installation is finished, restart Visual Studio by clicking on the Restart Now button.
Once installed, the Web Essentials package provides many web development productivity features, including CSS helpers, tools to work with Less CSS, enhancements to work with JavaScript, and, of course, a set of CoffeeScript helpers.
To add a new CoffeeScript file to your project, you can navigate to File | New Item or press Ctrl + Shift + A. This will display the Add New Item dialog, as seen in the following screenshot. Under the Web templates, you will see a new CoffeeScript File option. Select this option and give it a filename, as shown here:

When we have our CoffeeScript file open, Web Essentials will display the file in a split-screen editor. We can edit our code in the left-hand pane, while Web Essentials displays a live preview of the JavaScript code that will be generated for us.
The Web Essentials CoffeeScript compiler will create two JavaScript files each time we save our CoffeeScript file: a basic JavaScript file and a minified version. For example, if we save a CoffeeScript file named employee.coffee
, the compiler will create employee.js
and employee.min.js
files.
- Data Visualization with D3 4.x Cookbook(Second Edition)
- ClickHouse性能之巔:從架構設計解讀性能之謎
- Visual C++程序設計教程
- 復雜軟件設計之道:領域驅動設計全面解析與實戰
- C語言程序設計(第3版)
- 動手玩轉Scratch3.0編程:人工智能科創教育指南
- Building Mapping Applications with QGIS
- 概率成形編碼調制技術理論及應用
- Learning Vaadin 7(Second Edition)
- 軟件測試教程
- Python入門很輕松(微課超值版)
- 深入理解BootLoader
- Arduino Wearable Projects
- Mastering Apache Camel
- Deep Learning for Natural Language Processing