×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Nicolás Romero
Added: Sep 14, 2015 8:31 PM
Modified: Sep 15, 2015 11:50 AM
Views: 6
init
  1. primeiro criar um arquivo package.json no diretorio
  2. {
  3.   "name": "min-project",
  4.   "version": "0.1.0",
  5.   "devDependencies": {
  6.     "grunt": "~0.4.5",
  7.     "grunt-contrib-uglify": "~0.5.0" // define as dependencias
  8. }
  9.  
  10. Depois criar um arquivo Gruntfile.js    
  11. module.exports = function(grunt) {
  12.   grunt.initConfig({
  13.     pkg: grunt.file.readJSON('package.json'),
  14.     uglify: {
  15.       build: {
  16.         src: 'jquery-2.1.1.js',
  17.         dest: 'jquery-2.1.1.min.js'
  18.       }
  19.     }
  20.   });
  21.   //carrega modulos
  22.   grunt.loadNpmTasks('grunt-contrib-uglify');
  23.   //registra tarefa (task) a executar
  24.   grunt.registerTask('default',['uglify']);
  25. };