Skip to content

Instantly share code, notes, and snippets.

@jboesch
Created June 7, 2013 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jboesch/5726186 to your computer and use it in GitHub Desktop.
Save jboesch/5726186 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
uglify: {
build: {
files: {
'jquery.timeAutocomplete.min.js': ['src/*.js']
}
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);
};
@jboesch
Copy link
Author

jboesch commented Jun 7, 2013

This is what I get when I "grunt uglify --verbose". Why is it saying [no src] for the "name" prop in my package.json file? I'm not trying to uglify that at all. It's using the "name" prop and trying to tack on ".min.js" on it... Don't know why.

Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK

Registering "grunt-contrib-uglify" local Npm module tasks.
Reading /Applications/MAMP/htdocs/time_autocomplete/node_modules/grunt-contrib-uglify/package.json...OK
Parsing /Applications/MAMP/htdocs/time_autocomplete/node_modules/grunt-contrib-uglify/package.json...OK
Loading "uglify.js" tasks...OK
+ uglify
Loading "Gruntfile.js" tasks...OK
+ default

Running tasks: uglify

Running "uglify" task

Running "uglify:build" (uglify) task
Verifying property uglify.build exists in config...OK
Files: [no src] -> build/jQueryTimeAutocomplete.min.js
Minifying with UglifyJS...Warning: Uglification failed. Use --force to continue.

Aborted due to warnings.

@jboesch
Copy link
Author

jboesch commented Jun 7, 2013

package.json:

{
    "name": "jQueryTimeAutocomplete",
    "title": "jQueryTimeAutocomplete",
    "description": "A time autocomplete plugin similar to how Google Calendar's time autocomplete works.",
    "version": "1.0.0",
    "homepage": "http://7shifts.com/blog/better-time-drop-downs-for-scheduling-jquery-timeautocomplete/",
    "repository": {
        "type": "git",
        "url": "https://github.com/7shifts/jQueryTimeAutocomplete.git"
    },
    "devDependencies": {
        "grunt": "0.4.1",
        "grunt-contrib-uglify": "0.2.0",
        "grunt-contrib-concat": "~0.3.0"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment