-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
81 lines (78 loc) · 1.8 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
module.exports = function(grunt){
//project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
multiple: {
command: [
'tsd reinstall --save',
'grunt bower:install',
'tsc --declaration src/ts/app/**/*.ts --outDir src/ts/typings/app'
].join('&&')
}
},
typescript: {
base: {
src: ['src/ts/**/*.ts'],
dest: 'dist/js',
options: {
module: 'amd', //or commonjs
target: 'es5', //or es3
basePath: 'src/ts',
sourceMap: true,
declaration: true,
watch: true,
references: 'typings/**/*.d.ts'
}
}
},
sass: {
options: {
sourceMap: true
},
dist: {
files: {
'dist/css/styles.css': 'src/scss/styles.scss'
}
}
},
qunit: {
all: ['dist/tests.html']
},
watch: {
css: {
files: ['src/scss/**/*.scss'],
tasks: ['sass']
},
qunit: {
files: ['src/ts/**/*.ts'],
tasks: ['qunit']
}
},
concurrent: {
options: {
logConcurrentOutput: true
},
dev: {
tasks: ["watch:css", "typescript:base", "watch:qunit"]
}
},
bower: {
install: {
options : {
targetDir : "dist/lib"
}
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.registerTask('default',['shell', 'qunit']);
grunt.registerTask('test', ['qunit']);
grunt.registerTask("dev", ["concurrent:dev"]);
};