Last active
December 15, 2015 03:59
-
-
Save ryanneufeld/5198854 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| "use strict"; | |
| module.exports = function(grunt) { | |
| // Override process.stdout to log the name+args of the current task before | |
| // every logged line. | |
| var hooker = require('hooker'); | |
| var newline = true; | |
| hooker.hook(process.stdout, 'write', function(str) { | |
| var prefix = grunt.task.current.nameArgs; | |
| //I want to check for logFile here. | |
| if (newline && prefix && str !== '\n') { | |
| newline = false; | |
| str = '[' + prefix + '] ' + str; | |
| } | |
| newline = /\n/.test(str); | |
| return hooker.filter(this, [str]); | |
| }); | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| uglify: { | |
| options: { | |
| banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd-hh:MM:ss") %> v<%= pkg.version %> */\n' | |
| }, | |
| build: { | |
| expand: true, | |
| cwd: 'js/raw', | |
| src: '**/*.js', | |
| dest: 'js/min/', | |
| ext: '.js' | |
| }, | |
| logFile : 'uglify.log' | |
| }, | |
| }); | |
| // Load the plugin that provides the "uglify" task. | |
| grunt.loadNpmTasks('grunt-contrib-uglify'); | |
| // Default task(s). | |
| grunt.registerTask('default', ['uglify']); | |
| }; |
cowboy
commented
Mar 19, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment