Skip to content

Commit

Permalink
Added compress task to create a zip file too
Browse files Browse the repository at this point in the history
  • Loading branch information
1ed committed Mar 28, 2014
1 parent b67c477 commit 167b40b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
29 changes: 25 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,44 @@ module.exports = function( grunt ) {

grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-crx');
grunt.loadNpmTasks('grunt-contrib-compress');

var config = {
app: 'src',
dist: 'dist',
package: grunt.file.readJSON('package.json')
};

grunt.initConfig({
config: config,
jslint: {
app: {
src: [
'src/scripts/**/*.js'
'<%= config.app %>/scripts/**/*.js'
]
}
},
crx: {
toggl: {
"src": "src/",
"dest": "dist/",
"src": "<%= config.app %>",
"dest": "<%= config.dist %>",
"privateKey": "toggl-button.pem"
}
},
compress: {
dist: {
options: {
archive: '<%= config.dist %>/<%= config.package.name %>-<%= config.package.version %>.zip'
},
files: [{
expand: true,
cwd: '<%= config.app %>/',
src: ['**'],
dest: ''
}]
}
}
});

grunt.registerTask('default', ['jslint', 'crx']);
grunt.registerTask('default', ['jslint', 'crx', 'compress']);
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"devDependencies": {
"grunt": "~0.4.4",
"grunt-crx": "~0.3.3",
"grunt-jslint": "~1.1.8"
"grunt-jslint": "~1.1.8",
"grunt-contrib-compress": "~0.7.0"
}
}

0 comments on commit 167b40b

Please sign in to comment.