-
Notifications
You must be signed in to change notification settings - Fork 57
/
Gruntfile.js
117 lines (109 loc) · 2.02 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
105
106
107
108
109
110
111
112
113
114
115
116
117
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
cruft: {
option: {
dot: true
},
src: [
'tscommand-*.tmp.txt',
'test/**/.baseDir*'
]
},
tmp: [
'tmp/**/*',
'test/tmp/**/*'
],
test: [
'test/build/**/*'
]
},
ts: {
options: {
fast: 'never',
target: 'es5',
module: 'commonjs',
declaration: true,
removeComments: false,
sourceMap: false
},
main: {
src: [
'./lib/index.ts',
],
options: {
"target": "es5",
"module": "commonjs",
"isolatedModules": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": false,
"noImplicitAny": true,
"removeComments": true,
"noLib": false,
"preserveConstEnums": false,
"suppressImplicitAnyIndexErrors": false
}
},
test: {
src: ['test/src/main/index.ts'],
outDir: 'test/build/sub/'
},
testEs6: {
src: ['test/src/es6/index.ts'],
outDir: 'test/build/es6/'
},
testCommonJs: {
src: ['test/src/commonjs/index.ts'],
outDir: 'test/build/commonjs'
},
testConflicts: {
src: ['test/src/conflicts/dirname/index.ts'],
outDir: 'test/build/conflicts/dirname'
}
},
mochaTest: {
options: {
timeout: 5000,
reporter: 'mocha-unfunk-reporter'
},
all: {
src: 'test/test.js'
}
}
});
grunt.registerTask('prep', [
'clean:tmp',
'clean:test',
'clean:cruft'
]);
grunt.registerTask('test', [
'prep',
'ts:test',
'ts:testEs6',
'ts:testCommonJs',
'ts:testConflicts',
'run'
]);
grunt.registerTask('run', [
'clean:tmp',
'ts:main',
'mochaTest:all',
'sweep'
]);
grunt.registerTask('prepublish', [
'build',
'ts:test',
'mochaTest:all',
'sweep'
]);
grunt.registerTask('sweep', [
'clean:cruft'
]);
grunt.registerTask('default', ['test']);
};