Automatic zip creating Grunt
This commit is contained in:
parent
2a99139364
commit
4bf38eb66a
21
Gruntfile.js
21
Gruntfile.js
@ -3,6 +3,7 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
manifest: grunt.file.readJSON('Mobile/manifest.webapp'),
|
||||
uglify: {
|
||||
main: {
|
||||
files: [
|
||||
@ -93,6 +94,23 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
|
||||
zip: {
|
||||
mobile: {
|
||||
router: function(path) {
|
||||
return /build\/mobile\/(.*)/.exec(path)[1];
|
||||
},
|
||||
src: 'build/mobile/**',
|
||||
dest: 'build/sketchy-mobile-<%= manifest.version %>.zip'
|
||||
},
|
||||
web: {
|
||||
router: function(path) {
|
||||
return /build\/web\/(.*)/.exec(path)[1];
|
||||
},
|
||||
src: 'build/web/**',
|
||||
dest: 'build/sketchy-web-<%= manifest.version %>.zip'
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
js: {
|
||||
files: ['Shared/js/**', 'Mobile/js/**', 'Web/js/**'],
|
||||
@ -122,6 +140,7 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.registerTask('default', ['uglify','copy', 'less'])
|
||||
grunt.loadNpmTasks('grunt-zip');
|
||||
grunt.registerTask('default', ['uglify','copy', 'less', 'zip'])
|
||||
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -15,7 +15,8 @@
|
||||
"grunt-contrib-less": "~0.9.0",
|
||||
"grunt-contrib-uglify": "~0.2.2",
|
||||
"grunt-contrib-copy": "~0.5.0",
|
||||
"grunt-contrib-watch": "~0.5.3"
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
"grunt-zip": "~0.12.0"
|
||||
},
|
||||
"keywords": [
|
||||
"Sketch",
|
||||
@ -24,7 +25,4 @@
|
||||
],
|
||||
"author": "Mahdi Dibaiee",
|
||||
"license": "GPL V2",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.2"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user