-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
65 lines (63 loc) · 2.11 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-tsd');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 8080,
base: './'
}
}
},
tsd: {
refresh: {
options: {
command: 'reinstall',
latest: false,
config: 'tsd.json'
}
}
},
ts: {
dev: { // a particular target
src: [
'src/**/*.ts', 'test/**/*.ts'
], // The source typescript files, http://gruntjs.com/configuring-tasks#files
html: ["app/**/*.html"], // The source html files, https://github.com/basarat/grunt-ts#html-2-typescript-support
reference: "references.ts", // If specified, generate this file that you can use for your reference management
// out: 'js/out.js', // If specified, generate an out.js file which is the merged js file
// watch: 'src' // watch is done by grunt-contrib-watch instead
}
},
jasmine: {
src : 'src/**/*.js',
options: {
specs: 'test/*Spec.js',
helpers: 'test/*Helper.js'
}
},
watch: {
typescript: {
files: ['src/**/*.ts', 'test/**/*.ts'],
tasks: ['ts', 'jasmine'],
options: {
spawn: false
},
}
},
open: {
dev: {
path: 'http://localhost:8080/index.html'
}
}
});
grunt.registerTask('init', ['tsd']);
grunt.registerTask('default', ['watch']);
grunt.registerTask('test', ['jasmine']);
}