-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntFile.js
101 lines (94 loc) · 2.78 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
'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
grunt.initConfig({
concat: {
js: {
options: {
banner:
'angular.module(\'ng-swagger\', [\'ng-swagger.directives\',' +
'\'ng-swagger.controllers\',' +
'\'ng-swagger.services\',' +
'\'ng-swagger.filters\',' +
'\'ng-swagger.templates\']);\n'
},
src: ['./src/scripts/*.js'],
dest: './dist/angular-swagger.js'
},
css: {
src: ['./src/styles/*.css'],
dest: './dist/angular-swagger.css'
}
},
htmlangular: {
options: {
customtags: [
'api-docs',
'api-path',
'api-param',
'api-model'
],
},
files: {
src: ['src/views/templates/*.html'],
}
},
html2js: {
app: {
options: {
base: './src/views/templates/',
useStrict: true,
quoteChar: '\'',
htmlmin: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
removeEmptyAttributes: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
}
},
src: ['./src/views/{,*/}*.html'],
dest: './src/scripts/templates.js',
module: 'ng-swagger.templates'
}
},
uglify: {
js: {
src: ['./dist/angular-swagger.js'],
dest: './dist/angular-swagger.min.js'
}
},
cssmin: {
target: {
files: {
'./dist/angular-swagger.min.css': ['./dist/angular-swagger.css']
}
}
},
watch: {
files: [
'./src/views/{,*/}*.html',
'./src/scripts/*.js',
'./src/styles/*.css'
],
tasks: 'quick'
}
});
grunt.registerTask('default', [
'htmlangular',
'html2js',
'concat',
'uglify',
'cssmin'
]);
grunt.registerTask('quick', [
'html2js',
'concat',
'uglify',
'cssmin'
]) ;
};