Created
June 14, 2013 03:45
-
-
Save candidosales/5779324 to your computer and use it in GitHub Desktop.
Tutorial de grunt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
// Metadata. | |
pkg: grunt.file.readJSON('package.json'), | |
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + | |
'<%= grunt.template.today("yyyy-mm-dd") %>\n' + | |
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + | |
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + | |
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n', | |
// Task configuration. | |
dirs: { | |
srcJs: 'js/foundation', | |
srcCss: 'css', | |
dest: 'dist', | |
}, | |
concat: { | |
options: { | |
banner: '<%= banner %>', | |
stripBanners: true | |
}, | |
js: { | |
src: ['<%= dirs.srcJs %>/*.js'], | |
dest: '<%= dirs.dest %>/<%= pkg.name %>.js' | |
}, | |
css: { | |
src: ['<%= dirs.srcCss %>/normalize.css','<%= dirs.srcCss %>/foundation.css'], | |
dest: '<%= dirs.dest %>/<%= pkg.name %>.css' | |
} | |
}, | |
uglify: { | |
js: { | |
files: { | |
'<%= dirs.dest %>/<%= pkg.name %>.min.js': ['<%= dirs.dest %>/<%= pkg.name %>.js'] | |
} | |
} | |
}, | |
cssmin: { | |
add_banner: { | |
keepSpecialComments: 0, | |
files: { | |
'<%= dirs.dest %>/<%= pkg.name %>.min.css': ['<%= dirs.dest %>/<%= pkg.name %>.css'] | |
} | |
} | |
} | |
}); | |
// These plugins provide necessary tasks. | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
// Default task. | |
grunt.registerTask('default', ['concat','uglify','cssmin']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muito bom. Achei este link lá no seu tutorial. Obrigado!