forked from cbowdon/TsMonad
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
71 lines (64 loc) · 2.16 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
module.exports = function (grunt) {
'use strict';
var sources = [ 'tsmonad.ts', 'maybe.ts', 'either.ts', 'monad.ts', 'writer.ts' ],
tests = [ 'test/*.ts' ];
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-banner');
grunt.initConfig({
typescript: {
options: {
sourceMap: true,
noImplicitAny: true,
declaration: true,
comments: true
},
main: {
src: sources,
dest: 'dist/tsmonad.js'
},
test: {
src: tests,
dest: 'test/bin/tsmonad-test.js'
}
},
watch: {
tasks: [ 'typescript', 'copy' ],
files: sources.concat(tests)
},
copy: {
test: {
expand: true,
src: [
'test/index.html',
'test/bin/*.js',
'node_modules/underscore/underscore-min.js',
'node_modules/qunitjs/qunit/qunit.css',
'node_modules/qunitjs/qunit/qunit.js',
'node_modules/blanket/dist/qunit/blanket.min.js',
'dist/tsmonad.js'
],
dest: 'test/dist/',
flatten: true
}
},
banner: '// Type definitions for TsMonad\n' +
'// Project: https://github.com/cbowdon/TsMonad\n' +
'// Definitions by: Chris Bowdon <https://github.com/cbowdon>\n' +
'// Definitions: https://github.com/borisyankov/DefinitelyTyped\n',
usebanner: {
dts: {
options: {
position: 'top',
banner: '<%= banner %>',
linebreak: true
},
files: {
src: [ 'dist/tsmonad.d.ts' ]
}
}
}
});
grunt.registerTask('default', 'Compiles TypeScript and prepares dist', [ 'typescript', 'copy', 'usebanner' ]);
};