Grunt Up & Running from Using Grunt For A Better Workflow.
'use strict'; | |
var packagejson = require('./package.json'); | |
module.exports = function (grunt) { | |
// Configuration | |
grunt.initConfig({ | |
pkg: packagejson, | |
watch: { | |
scripts: { | |
files: ['<%= pkg.name %>.js'], | |
tasks: ['default'] | |
} | |
}, | |
jshint: { | |
build: [ | |
'<%= pkg.name %>.js' | |
] | |
}, | |
uglify: { | |
options: { | |
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + | |
'<%= grunt.template.today("yyyy-mm-dd") %> */' | |
}, | |
build: { | |
src: '<%= pkg.name %>.js', | |
dest: 'build/<%= pkg.name %>.min.js' | |
} | |
} | |
}); | |
grunt.registerTask('default', [ | |
'jshint', | |
'uglify' | |
]); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
}; |
npm install |
npm install -g grunt-cli |
npm install grunt-contrib-watch --save-dev |
{ | |
"name": "realchaseadams", | |
"version": "1.0.24", | |
"description": "Yeoman / Grunt workflow for realchaseadams", | |
"dependencies": {}, | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"grunt-contrib-jshint": "~0.5.2", | |
"grunt-contrib-uglify": "~0.2.0", | |
"grunt-contrib-watch": "~0.5.3" | |
}, | |
"engines": { | |
"node": ">=0.8.0" | |
} | |
} |
(function() { | |
var foo = "hello ", | |
bar = "world!"; | |
console.log(foo + bar); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
on your site
I think you told jshint to lint the file "realchaseadams.js", since your using '<%= pkg.name %>.js' in your Gruntfile.js (as with the other tasks as well)