Skip to content

Instantly share code, notes, and snippets.

View bmarshall511's full-sized avatar

Ben Marshall bmarshall511

View GitHub Profile
@bmarshall511
bmarshall511 / grunt.loadNpmTasks.js
Last active August 29, 2015 14:04
How to tell Grunt to load plugins with loadNpmTasks.
// tell Grunt to load a plugin
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
@bmarshall511
bmarshall511 / load-grunt-tasks.js
Last active August 29, 2015 14:04
How to autoload Grunt plugins with load-grunt-tasks.
require('load-grunt-tasks')(grunt);
@bmarshall511
bmarshall511 / Gruntfile.js
Last active August 29, 2015 14:04
Used to configure and load Grunt plugins.
module.exports = function(grunt) {
// Measures the time each task takes
require('time-grunt')(grunt);
// Load Grunt config
require('load-grunt-config')(grunt);
};
@bmarshall511
bmarshall511 / package.json
Last active August 29, 2015 14:04
Used by npm to store metadata for projects published as npm modules
{
"name": "grunt-project",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-concurrent": "*",
"grunt-contrib-compass": "*",
"grunt-contrib-jshint": "*",
"grunt-contrib-uglify": "*",
"grunt-contrib-watch": "*",
@bmarshall511
bmarshall511 / aliases.yaml
Last active August 29, 2015 14:04
Used to register task aliases.
default:
- 'concurrent:compass'
- 'concurrent:watch'
@bmarshall511
bmarshall511 / compass.js
Created July 16, 2014 15:31
Grunt Compass plugin configuration file.
module.exports = {
dev: {
options: {
config: 'config.rb',
watch: true
}
},
prod: {
options: {
config: 'config.rb',
@bmarshall511
bmarshall511 / load-grunt-config.js
Last active August 29, 2015 14:04
How to autoload Grunt plugin configs with load-grunt-config.
module.exports = function(grunt) {
// Load grunt config
require('load-grunt-config')(grunt);
};
@bmarshall511
bmarshall511 / watch.js
Created July 16, 2014 15:42
Grunt Watch configuration file.
module.exports = {
gruntfile: {
files: 'Gruntfile.js',
tasks: ['jshint:gruntfile']
},
scripts: {
files: ['src/js/**/*.js'],
tasks: ['jshint:all']
}
};
@bmarshall511
bmarshall511 / aliases-newer.yaml
Created July 17, 2014 13:00
Grunt aliases file using grunt-newer.
default:
- 'newer:compass'
- 'newer:watch'
@bmarshall511
bmarshall511 / concurrent.js
Created July 17, 2014 13:07
Grunt Concurrent plugin configuration.
module.exports = {
options: {
logConcurrentOutput: true
},
watch: ['watch', 'compass:dev']
};