Last active
March 19, 2016 07:06
-
-
Save curiouslychase/7354446 to your computer and use it in GitHub Desktop.
Grunt Up & Running from Using Grunt For A Better Workflow.
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
'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'); | |
}; |
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
npm install |
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
npm install -g grunt-cli |
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
npm install grunt-contrib-watch --save-dev |
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
{ | |
"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" | |
} | |
} |
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
(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
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)