This repository has been archived by the owner on Mar 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
121 lines (111 loc) · 3.49 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
118
119
120
121
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 9001,
base: 'src',
keepalive: true
}
},
e2e: {
options: {
port: 9002,
base: 'dist'
}
}
},
karma: {
unit: {
configFile: 'test/unit/karma.conf.js',
autoWatch: true
},
'unit-single': {
configFile: 'test/unit/karma.conf.js',
singleRun: true
},
e2e: {
configFile: 'test/e2e/karma.conf.js',
singleRun: true
}
},
clean: {
build: ['tmp', 'dist']
},
html2js: {
templates: {
options: {
module: 'templates-quizz'
},
src: ['src/templates/*.html'],
dest: 'tmp/templates-quizz.js'
}
},
concat: {
'quizz-no-template': {
src: ['src/js/quizz-module-no-template.js', 'src/js/controllers/*.js', 'src/js/directives/*.js'],
dest: 'dist/js/quizz.js'
},
'quizz-template': {
src: ['src/js/quizz-module-template.js', 'src/js/controllers/*.js', 'src/js/directives/*.js', 'tmp/templates-quizz.js'],
dest: 'dist/js/quizz-tmpl.js'
}
},
uglify: {
'quizz-no-template': {
files: {
'dist/js/quizz.min.js': ['dist/js/quizz.js']
}
},
'quizz-template': {
files: {
'dist/js/quizz-tmpl.min.js': ['dist/js/quizz-tmpl.js']
}
}
},
copy: {
css: {
cwd: 'src/',
expand: true,
src: 'css/*',
dest: 'dist/'
},
js: {
cwd: 'src/bower_components/',
expand: true,
src: [
'angular/angular.min.js',
'angular-animate/angular-animate.min.js',
'showdown/compressed/showdown.js'
],
flatten: true,
dest: 'dist/js/'
},
'example-js': {
cwd: 'src/',
expand: true,
src: 'js/example-quizz.js',
dest: 'dist/'
},
'example-html': {
cwd: 'example/',
expand: true,
src: '**/*',
dest: 'dist/'
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['clean', 'html2js', 'concat', 'uglify', 'copy']);
grunt.registerTask('unit', ['karma:unit']);
grunt.registerTask('unit-single', ['karma:unit-single']);
grunt.registerTask('e2e', ['default', 'connect:e2e', 'karma:e2e']);
grunt.registerTask('server', ['connect:server']);
};