Skip to content

Commit

Permalink
add js minify config to grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
mariez committed Nov 10, 2016
1 parent 39fd677 commit 9e15d81
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 23 additions & 2 deletions gruntfile.js
Expand Up @@ -2,6 +2,26 @@ module.exports = function(grunt) {
require('jit-grunt')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['js/phpList3ToBootstrap.js','bootstrap/dist/js/bootstrap.min.js','js/jcarousellite_1.0.1.min.js','js/phplist.js'],
dest: 'js/dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'js/dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
less: {
development: {
options: {
Expand All @@ -24,6 +44,7 @@ module.exports = function(grunt) {
}
}
});

grunt.registerTask('default', ['less', 'watch']);
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['less', 'watch','concat','uglify']);
};
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -4,7 +4,9 @@
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-less": "^1.3.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "^1.0.0",
"jit-grunt": "^0.10.0"
}
Expand Down

0 comments on commit 9e15d81

Please sign in to comment.