Skip to content

Commit

Permalink
Uglify JS task
Browse files Browse the repository at this point in the history
  • Loading branch information
bassettsj committed Jun 2, 2014
1 parent a24e0ee commit 45e3117
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ module.exports = function(grunt) {
dest: './dist/js/awesome-theme.pkg.js',
src: './src/index.js'
}
},
uglify: {
themejs: {
options:{
sourceMap: true,
banner: '<%= banner %>'
},
src: '<%= browserify.themejs.dest %>',
dest: './dist/js/',
ext: '.pkg.min.js',
expand: true,
flatten: true
}
}
});

Expand All @@ -110,6 +123,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.registerTask(
'default',
Expand All @@ -130,7 +144,8 @@ module.exports = function(grunt) {
'Lint, test and bundle theme\'s JS',
[
'jshint:themejs',
'browserify:themejs'
'browserify:themejs',
'uglify:themejs'
]
);
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"jshint-stylish": "^0.2.0",
"browserify": "^4.1.6",
"grunt-browserify": "^2.1.0",
"grunt-autoprefixer": "^0.7.3",
"browserify-shim": "^3.5.0"
"browserify-shim": "^3.5.0",
"grunt-contrib-uglify": "^0.4.0"
},
"browserify-shim": {
"jquery": "global:jQuery",
Expand Down

0 comments on commit 45e3117

Please sign in to comment.