Advertisement
Varun_Krishna

Gruntfile.js and package.json for the task uglify

Nov 17th, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Gruntfile.js
  2. module.exports = function(grunt){
  3.     grunt.initConfig({
  4.         pkg: grunt.file.readJSON('package.json'),
  5.         uglify: {
  6.             options: {
  7.                 mangle: true
  8.             },
  9.             mytarget: {
  10.                 files: {
  11.                     'dest/output.min.js' : ['src/*.js']
  12.                 }
  13.             }//end of my_target
  14.         }//end of uglify
  15.     });
  16.     grunt.loadNpmTasks('grunt-contrib-uglify');
  17.  
  18.     grunt.registerTask('default',['uglify']);
  19. };
  20.  
  21.  
  22. //package.json
  23. {
  24.   "name": "Uglification",
  25.   "version": "0.1.0",
  26.   "description": "used for minification of js files",
  27.   "main": "index.js",
  28.   "scripts": {
  29.     "test": "echo \"Error: no test specified\" && exit 1"
  30.   },
  31.   "keywords": [
  32.     "uglify",
  33.     "minify",
  34.     "compress"
  35.   ],
  36.   "author": "Demon",
  37.   "license": "BSD-2-Clause",
  38.   "devDependencies": {
  39.     "grunt": "~0.4.1",
  40.     "grunt-contrib-uglify": "~0.2.7"
  41.   }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement