@@ -8,14 +8,68 @@ module.exports = function(grunt) {
8
8
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> <%= pkg.author.url %>\n' +
9
9
' * License: <%= pkg.license %>\n' +
10
10
' */\n' ,
11
-
11
+ jshint : {
12
+ all : [
13
+ './src/*.js' , '*.js' , '*.json'
14
+ ] ,
15
+ options : {
16
+ jshintrc : '.jshintrc'
17
+ }
18
+ } ,
19
+ ngtemplates : {
20
+ options : {
21
+ module : 'angular-advanced-searchbox' ,
22
+ htmlmin : {
23
+ collapseBooleanAttributes : true ,
24
+ collapseWhitespace : true ,
25
+ removeAttributeQuotes : true ,
26
+ removeComments : true , // Only if you don't use comment directives!
27
+ removeEmptyAttributes : true ,
28
+ removeRedundantAttributes : true ,
29
+ removeScriptTypeAttributes : true ,
30
+ removeStyleLinkTypeAttributes : true
31
+ }
32
+ } ,
33
+ template : {
34
+ src : [ 'src/*.html' ] ,
35
+ dest : 'tmp/templates.js'
36
+ } ,
37
+ } ,
38
+ concat : {
39
+ template : {
40
+ options : {
41
+ } ,
42
+ src : [ 'src/<%= pkg.name %>.js' , '<%= ngtemplates.template.dest %>' ] ,
43
+ dest : 'dist/<%= pkg.name %>-tpls.js'
44
+ }
45
+ } ,
46
+ copy : {
47
+ main : {
48
+ files : [
49
+ {
50
+ src : [ 'src/<%= pkg.name %>.js' ] ,
51
+ dest : 'dist/<%= pkg.name %>.js'
52
+ }
53
+ ]
54
+ } ,
55
+ template : {
56
+ files : [
57
+ {
58
+ src : [ 'src/<%= pkg.name %>.html' ] ,
59
+ dest : 'dist/<%= pkg.name %>.html'
60
+ }
61
+ ]
62
+ }
63
+ } ,
12
64
uglify : {
13
65
options : {
14
66
banner : '<%= banner %>'
15
67
} ,
16
- build : {
17
- src : 'src/<%= pkg.name %>.js' ,
18
- dest : 'build/<%= pkg.name %>.min.js'
68
+ dist : {
69
+ files : {
70
+ 'dist/<%= pkg.name %>.min.js' : [ 'dist/<%= pkg.name %>.js' ] ,
71
+ 'dist/<%= pkg.name %>-tpls.min.js' : [ 'dist/<%= pkg.name %>-tpls.js' ] ,
72
+ }
19
73
}
20
74
} ,
21
75
cssmin : {
@@ -25,36 +79,39 @@ module.exports = function(grunt) {
25
79
} ,
26
80
minify : {
27
81
src : 'src/<%= pkg.name %>.css' ,
28
- dest : 'build /<%= pkg.name %>.min.css'
82
+ dest : 'dist /<%= pkg.name %>.min.css'
29
83
}
30
84
} ,
31
- copy : {
32
- template : {
33
- files : [
34
- {
35
- src : [ 'src/angular-advanced-searchbox.html' ] ,
36
- dest : 'build/angular-advanced-searchbox.html'
37
- }
38
- ]
85
+ clean : {
86
+ temp : {
87
+ src : [ 'tmp' ]
39
88
}
40
89
} ,
41
- jshint : {
42
- all : [
43
- './src/*.js' , '*.json'
44
- ] ,
90
+ bump : {
45
91
options : {
46
- jshintrc : '.jshintrc'
92
+ files : [ 'package.json' , 'bower.json' ] ,
93
+ updateConfigs : [ 'pkg' ] ,
94
+ commit : true ,
95
+ commitFiles : [ '-a' ] ,
96
+ createTag : true ,
97
+ push : true ,
98
+ pushTo : 'origin'
47
99
}
48
100
}
49
101
} ) ;
50
102
51
103
// Load the plugins
104
+ grunt . loadNpmTasks ( 'grunt-bump' ) ;
105
+ grunt . loadNpmTasks ( 'grunt-contrib-clean' ) ;
106
+ grunt . loadNpmTasks ( 'grunt-contrib-concat' ) ;
107
+ grunt . loadNpmTasks ( 'grunt-contrib-copy' ) ;
52
108
grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
53
109
grunt . loadNpmTasks ( 'grunt-contrib-cssmin' ) ;
54
110
grunt . loadNpmTasks ( 'grunt-contrib-jshint' ) ;
55
111
grunt . loadNpmTasks ( 'grunt-contrib-copy' ) ;
112
+ grunt . loadNpmTasks ( 'grunt-angular-templates' ) ;
56
113
57
114
// Default task(s).
58
- grunt . registerTask ( 'default' , [ 'jshint:all' , 'uglify ' , 'cssmin ' , 'copy' ] ) ;
115
+ grunt . registerTask ( 'default' , [ 'clean' , ' jshint:all', 'ngtemplates ' , 'concat ' , 'copy' , 'uglify' , 'cssmin '] ) ;
59
116
60
117
} ;
0 commit comments