-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntFile.js
104 lines (100 loc) · 3.08 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
module.exports = function (grunt) {
// Prepare our gtx wrapper
var gtx = require('gruntfile-gtx').wrap(grunt);
// Load our npm task dependencies
gtx.loadNpm([
'grunt-contrib-uglify',
'grunt-typescript',
'grunt-tslint',
'grunt-karma',
'grunt-contrib-copy'
]);
// Load up our configuration
gtx.config({
typescript: {
base: {
src: ["src/**/*.ts"],
dest: "build/CakeTS.js",
options: {
"target": "es5",
"sourceMap": true,
"declaration": true
}
}
},
uglify: {
app: {
options: {
sourceMap: true,
sourceMapIncludeSources: true,
inSourceMap: "build/CakeTS.js.map",
sourceMapName: "build/CakeTS.min.js.map",
mangle: true,
beautify: false,
compress: true
},
files: {
'build/CakeTS.min.js': 'build/CakeTS.js'
}
}
},
tslint: {
options: {
configuration: gtx.readJSON("./tslint.json")
},
files: {
src: 'src/**/*.ts'
}
},
copy: {
dist: {
files: [
{src: 'build/*', dest: 'dist', expand: true, flatten: true}
],
options: {
noProcess: true
}
}
},
karma: {
build: {
options: {
files: [
'bower_components/jquery/dist/jquery.js',
'bower_components/knockout/dist/knockout.js',
'bower_components/Typertext/build/typertext.js',
'build/CakeTS.js',
'tests/**/*.js'
]
},
runnerPort: 9999,
singleRun: true,
browsers: ['PhantomJS'],
logLevel: 'ERROR',
frameworks: ['jasmine']
},
debug: {
options: {
files: [
'bower_components/jquery/dist/jquery.js',
'bower_components/knockout/dist/knockout.js',
'bower_components/Typertext/build/typertext.js',
'build/CakeTS.js',
'tests/**/*.js'
]
},
runnerPort: 9999,
singleRun: false,
browsers: ['Chrome'],
logLevel: 'ERROR',
frameworks: ['jasmine']
}
}
});
// Define our usable tasks
gtx.alias('default', ['build']);
gtx.alias('build', ['typescript', 'uglify', 'karma:build']);
gtx.alias('dist', ['tslint', 'build', 'copy:dist']);
// Initialize grunt
gtx.finalise();
};