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 41596bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions 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,11 +123,13 @@ 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',
'build css', [
'buildcss'
'buildcss',
'buidljs'
]
);
grunt.registerTask(
Expand All @@ -130,7 +145,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 41596bd

Please sign in to comment.