@@ -18,7 +18,6 @@ module.exports = function(grunt) {
1818 // Project configuration.
1919 grunt . initConfig ( {
2020 pluginName : 'smooth-scroll' ,
21- bower : './bower.json' ,
2221 pkg : grunt . file . readJSON ( 'package.json' ) ,
2322 meta : {
2423 banner : '/*!<%= "\\n" %>' +
@@ -32,7 +31,7 @@ module.exports = function(grunt) {
3231 '<%= "\\n" %>' + ' */' +
3332 '<%= "\\n\\n" %>'
3433 } ,
35- concat : {
34+ concat : {
3635 all : {
3736 src : [ 'src/jquery.<%= pluginName %>.js' ] ,
3837 dest : 'jquery.<%= pluginName %>.js'
@@ -41,8 +40,8 @@ module.exports = function(grunt) {
4140 stripBanners : true ,
4241 banner : '<%= meta.banner %>' ,
4342 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' ) ;
4645
4746 src = src
4847 . replace ( '(function($) {' , umdHead )
@@ -119,33 +118,17 @@ module.exports = function(grunt) {
119118 }
120119 } ) ;
121120
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-
138121 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 ) ;
143126
144127 grunt . file . write ( 'index.html' , head + doc + foot ) ;
145128 } ) ;
146129
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' ] ) ;
149132 grunt . registerTask ( 'default' , [ 'build' ] ) ;
150133
151134 grunt . loadNpmTasks ( 'grunt-contrib-jshint' ) ;
0 commit comments