diff --git a/Gruntfile.js b/Gruntfile.js index 800aeda..19615ff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -21,10 +21,8 @@ module.exports = function(grunt) { } }, - update_json: { - bower: { - src: 'package.json', - dest: 'bower.json', + package2bower: { + all: { fields: [ 'name', 'description', @@ -68,8 +66,6 @@ module.exports = function(grunt) { all: ['test/unit/**/*.js'] }, - webpack: require('./webpack.config.js'), - watch: { build: { files: ['lib/**/*.js'], @@ -79,10 +75,25 @@ module.exports = function(grunt) { files: ['lib/**/*.js', 'test/**/*.js', '!test/typescript/axios.js', '!test/typescript/out.js'], tasks: ['test'] } + }, + + webpack: require('./webpack.config.js') + }); + + grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function () { + var npm = grunt.file.readJSON('package.json'); + var bower = grunt.file.readJSON('bower.json'); + var fields = this.data.fields || []; + + for (var i=0, l=fields.length; i