Added grunt tasks

This commit is contained in:
Luis Leiva 2015-09-21 14:10:32 +02:00
parent 14e5f5776f
commit d2ffd6079f
2 changed files with 87 additions and 0 deletions

61
Gruntfile.js Normal file
View File

@ -0,0 +1,61 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
all: {
src: [
'jsketch.js',
'jquery.sketchable.js',
'jquery.sketchable.memento.js',
],
dest: 'dist/jsketch.all.js'
}
},
uglify: {
jsketch: {
files: {
'dist/jsketch.min.js': [ 'jsketch.js' ]
}
},
jsketchable: {
files: {
'dist/jquery.jsketchable.min.js': [ 'jquery.sketchable.js' ]
}
},
memento: {
files: {
'dist/jquery.jsketchable.memento.min.js': [ 'jquery.sketchable.memento.js' ]
}
},
all: {
options: {
banner: '/*! <%= pkg.description %> (all in one) | v<%= pkg.version %> | <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
files: {
'dist/jsketch.all.min.js': [ '<%= concat.all.dest %>' ]
}
}
},
clean: {
js: [
'dist/*.js', '!dist/*.min.js'
]
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('all', [ 'concat:all', 'uglify:all', 'clean' ]);
grunt.registerTask('jsketch', [ 'uglify:jsketch', 'clean' ]);
grunt.registerTask('jsketchable', [ 'uglify:jsketchable', 'clean' ]);
grunt.registerTask('memento', [ 'uglify:memento', 'clean' ]);
grunt.registerTask('default', [ 'concat:all', 'uglify:all', 'uglify:jsketch', 'uglify:jsketchable', 'uglify:memento', 'clean' ]);
};

26
package.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "jsketch",
"version": "1.8",
"description": "jSketch drawing lib",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/luileito/jsketch.git"
},
"keywords": [
"draw",
"sketch",
"strokes"
],
"author": "Luis A. Leiva",
"license": "ISC",
"dependencies": {
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-uglify": "^0.9.1"
}
}