-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
93 lines (89 loc) · 2.27 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: [{
expand: true,
cwd: 'styles/sass',
src: ['*.scss'],
dest: 'styles/css',
ext: '.css'
}]
}
},
typescript: {
base: {
src: ['scripts/ts/app/*.ts'],
dest: 'scripts/js/app/',
options: {
module: 'amd', //or commonjs
target: 'es5', //or es3
sourceMap: false,
declaration: false
}
},
specs: {
src: ['scripts/ts/specs/*.ts'],
dest: 'scripts/js/specs/',
options: {
module: 'amd', //or commonjs
target: 'es5', //or es3
sourceMap: false,
declaration: false
}
}
},
copy: {
main: {
files: [
{
cwd: 'node_modules/bootstrap-sass/assets/stylesheets',
src: 'bootstrap/**',
dest: 'styles/sass',
expand: true
},
{
cwd: 'node_modules/bootstrap-sass/assets/javascripts',
src: 'bootstrap.js',
dest: 'scripts/js/libs',
expand: true,
filter: 'isFile'
},
{
cwd: 'node_modules/knockout/build/output',
src: 'knockout-latest.js',
dest: 'scripts/js/libs',
expand: true,
filter: 'isFile'
}
],
},
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/<%= pkg.name %>.js',
dest: 'build/<%= pkg.name %>.min.js'
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
}
}
});
// Load tasks.
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-karma');
// Default task(s).
grunt.registerTask('default', ['uglify']);
grunt.registerTask('compile-all', ['sass', 'typescript','copy']);
grunt.registerTask('runtests', ['typescript:specs', 'copy', 'karma']);
};