Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Created November 1, 2015 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueleresca/8dbe86fa226a4ba2ec07 to your computer and use it in GitHub Desktop.
Save samueleresca/8dbe86fa226a4ba2ec07 to your computer and use it in GitHub Desktop.
module.exports = function (grunt) {
//REQUIRED MODULES
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
//________________
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 8080,
base: './'
}
}
},
typescript: {
base: {
src: ['Scripts/**/*.ts'], //all *.ts files
dest: 'Scripts/compiled/main.js', //compiled inside main.js
options: {
module: 'amd',
target: 'es5'
}
}
},
watch: {
files: '**/*.ts', //watch all *.ts files
tasks: ['typescript'] // run the typescript task
},
open: {
dev: {
path: 'http://localhost:8080/index.html'
}
}
});
grunt.registerTask('default', ['connect', 'open', 'watch']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment