-
Notifications
You must be signed in to change notification settings - Fork 0
/
GruntFile.js
90 lines (76 loc) · 2.32 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
// Generated on 2014-01-08 using generator-angular 0.7.1
'use strict';
module.exports = function (grunt) {
var config = {
pkg: grunt.file.readJSON('package.json'),
karma: {
dev: {
configFile: 'karma.conf.js',
singleRun: false
},
src: {
configFile: 'karma.conf.js',
singleRun: true
},
dist: {
options: {
files: [
'bower_components/lodash/dist/lodash.js',
'dist/<%= pkg.name %>.min.js',
'test/spec/**/*.js',
],
browsers: ['Firefox'],
singleRun: true,
frameworks: ['jasmine'],
port: 9899,
}
}
},
typescript: {
base: {
src: [
'bower_components/typings/lodash/lodash.ts',
'src/dotNeTS/Exception.ts',
'src/**/*.ts'
],
dest: 'dist/<%= pkg.name %>.js',
options: {
module: 'amd',
target: 'es5',
sourcemap: true,
declaration: true
}
}
},
uglify: {
dist: {
files: {
'dist/<%= pkg.name %>.min.js': [
'dist/<%= pkg.name %>.js'
]
}
}
},
watch: {
scripts: {
files: ['**/*.ts'],
tasks: [
'typescript',
'karma:src',
],
options: {
spawn: false,
},
},
}
};
grunt.initConfig(config);
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['karma:src', 'typescript', 'uglify', 'karma:dist']);
grunt.registerTask('build', ['default']);
grunt.registerTask('test', ['karma:dev']);
}