-
Notifications
You must be signed in to change notification settings - Fork 1
/
gruntfile.js
95 lines (92 loc) · 3.04 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
var grunt = require('grunt');
grunt.initConfig({
// -----------------------------------------------------------------------------------------------
// clean
// -----------------------------------------------------------------------------------------------
clean: {
build: {
src: ['dist/']
}
},
// -----------------------------------------------------------------------------------------------
// ts
// -----------------------------------------------------------------------------------------------
ts: {
options: {
compiler: './node_modules/typescript/bin/tsc',
noImplicitAny: true,
preserveConstEnums: true,
experimentalDecorators: true,
sourceMap: false,
removeComments: false,
target: 'es5',
},
system: {
options: {
module: 'system',
declaration: true,
},
files: [{ src: ['typings/tsd.d.ts', 'src/**/*.ts'], dest: 'dist/system/decorators.js' }],
},
es6: {
options: {
target: 'es6',
module: 'es6'
},
files: [{ src: ['typings/tsd.d.ts', 'src/**/*.ts'], dest: 'dist/es6/' }],
},
amd: {
options: {
module: 'amd'
},
files: [{ src: ['typings/tsd.d.ts', 'src/**/*.ts'], dest: 'dist/amd/decorators.js' }],
},
commonjs: {
options: {
module: 'commonjs',
},
files: [{ src: ['typings/tsd.d.ts', 'src/**/*.ts'], dest: 'dist/commonjs' }],
}
},
// -----------------------------------------------------------------------------------------------
// rename
// -----------------------------------------------------------------------------------------------
rename: {
declarations: {
src: 'dist/system/decorators.d.ts',
dest: 'dist/decorators.d.ts',
},
},
// -----------------------------------------------------------------------------------------------
// uglify
// -----------------------------------------------------------------------------------------------
uglify: {
system: {
files: {
'dist/system/decorators.min.js': ['dist/system/decorators.js']
}
},
amd: {
files: {
'dist/amd/decorators.min.js': ['dist/amd/decorators.js']
}
},
commonjs: {
files: {
'dist/commonjs/decorators.min.js': ['dist/commonjs/decorators.js']
}
}
},
karma: {
default: {
configFile: 'karma.conf.js'
}
}
});
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-rename');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('build', ['clean', 'ts', 'rename', 'uglify']);
grunt.registerTask('test', ['karma']);