Skip to content

mvidailhet/grunt-nodejs-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-nodejs-typescript

A powerful Grunt configuration that can lint and compile your TypeScript files and restart your node server each time you make a change to your code.

Here is the full article explaining step by step the making of this config: http://geeklearning.io/grunt-configuration-for-your-nodejs-server-in-typescript/

##Prerequesities

If you haven’t done it yet, to be able to run Grunt, you’ll have to first install Node.js. Then, install the Grunt CLI using npm (installed with NodeJS) by running this command:

npm install –g grunt-cli

You need TypeScript on your machine: ``` npm install –g typescript ```
Typescript is a typed language. It needs definitions files for the libraries you're using to be able to do it's work. There is an [opensource repository](http://definitelytyped.org/) full of TypeScript definitions for known libraries. Meaning someone has already done the job for us! There's a [manager]((http://www.tsdpm.com)) using this repository to make our work even simpler. So don't forget to install it: ``` npm install –g tsd@next ```
This configuration use [nodemon](https://github.com/remy/nodemon) to handle the node server. So you need to install it: ``` npm install -g nodemon ```

##Installation

Install necesseray npm packages:

npm install

Install necessary TypeScript definitions files:

tsd reinstall -s

##Commands

grunt

Will lint and compile your TypeScript files.


``` grunt serve ``` Will watch for changes in your code. When it detects a change, it lints the moddified file, compile the project and restart the node server.

About

A full Grunt config for your Node.JS server in TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published