@@ -18,7 +18,6 @@ module.exports = function(grunt) {
18
18
// Project configuration.
19
19
grunt . initConfig ( {
20
20
pluginName : 'smooth-scroll' ,
21
- bower : './bower.json' ,
22
21
pkg : grunt . file . readJSON ( 'package.json' ) ,
23
22
meta : {
24
23
banner : '/*!<%= "\\n" %>' +
@@ -32,7 +31,7 @@ module.exports = function(grunt) {
32
31
'<%= "\\n" %>' + ' */' +
33
32
'<%= "\\n\\n" %>'
34
33
} ,
35
- concat : {
34
+ concat : {
36
35
all : {
37
36
src : [ 'src/jquery.<%= pluginName %>.js' ] ,
38
37
dest : 'jquery.<%= pluginName %>.js'
@@ -41,8 +40,8 @@ module.exports = function(grunt) {
41
40
stripBanners : true ,
42
41
banner : '<%= meta.banner %>' ,
43
42
process : function ( src ) {
44
- var umdHead = grunt . file . read ( 'lib/tmpl/umdhead.tpl' ) ,
45
- umdFoot = grunt . file . read ( 'lib/tmpl/umdfoot.tpl' ) ;
43
+ var umdHead = grunt . file . read ( 'lib/tmpl/umdhead.tpl' ) ;
44
+ var umdFoot = grunt . file . read ( 'lib/tmpl/umdfoot.tpl' ) ;
46
45
47
46
src = src
48
47
. replace ( '(function($) {' , umdHead )
@@ -119,33 +118,17 @@ module.exports = function(grunt) {
119
118
}
120
119
} ) ;
121
120
122
- grunt . registerTask ( 'configs' , 'Update json configs based on package.json' , function ( ) {
123
- var pkg = grunt . file . readJSON ( 'package.json' ) ,
124
- pkgBasename = grunt . config ( 'pluginName' ) ,
125
- bowerFile = grunt . config ( 'bower' ) ,
126
- bower = grunt . file . readJSON ( bowerFile ) ;
127
-
128
- [ 'main' , 'dependencies' , 'keywords' ] . forEach ( function ( el ) {
129
- bower [ el ] = pkg [ el ] ;
130
- } ) ;
131
-
132
- bower . name = 'jquery-' + pkgBasename ;
133
-
134
- grunt . file . write ( bowerFile , JSON . stringify ( bower , null , 2 ) + '\n' ) ;
135
- grunt . log . writeln ( 'File "' + bowerFile + '" updated."' ) ;
136
- } ) ;
137
-
138
121
grunt . registerTask ( 'docs' , 'Convert readme.md to html and concat with header and footer for index.html' , function ( ) {
139
- var readme = grunt . file . read ( 'readme.md' ) ,
140
- head = grunt . template . process ( grunt . file . read ( 'lib/tmpl/header.tpl' ) ) ,
141
- foot = grunt . file . read ( 'lib/tmpl/footer.tpl' ) ,
142
- doc = marked ( readme ) ;
122
+ var readme = grunt . file . read ( 'readme.md' ) ;
123
+ var head = grunt . template . process ( grunt . file . read ( 'lib/tmpl/header.tpl' ) ) ;
124
+ var foot = grunt . file . read ( 'lib/tmpl/footer.tpl' ) ;
125
+ var doc = marked ( readme ) ;
143
126
144
127
grunt . file . write ( 'index.html' , head + doc + foot ) ;
145
128
} ) ;
146
129
147
- grunt . registerTask ( 'build' , [ 'jshint' , 'concat' , 'version:same' , 'configs' , ' uglify', 'docs' ] ) ;
148
- grunt . registerTask ( 'patch' , [ 'jshint' , 'concat' , 'version:bannerPatch' , 'version:patch' , 'configs' , ' uglify'] ) ;
130
+ grunt . registerTask ( 'build' , [ 'jshint' , 'concat' , 'version:same' , 'uglify' , 'docs' ] ) ;
131
+ grunt . registerTask ( 'patch' , [ 'jshint' , 'concat' , 'version:bannerPatch' , 'version:patch' , 'uglify' ] ) ;
149
132
grunt . registerTask ( 'default' , [ 'build' ] ) ;
150
133
151
134
grunt . loadNpmTasks ( 'grunt-contrib-jshint' ) ;
0 commit comments