Skip to content

Instantly share code, notes, and snippets.

@frankyonnetti
Last active February 17, 2021 02:50
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 frankyonnetti/8652410 to your computer and use it in GitHub Desktop.
Save frankyonnetti/8652410 to your computer and use it in GitHub Desktop.
Grunt #node #grunt
// Type `npm install` from this directory
module.exports = function(grunt) {
'use strict';
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dist: {
options: {
//config: 'config.rb',
sassDir: 'sass',
cssDir: 'css',
sourcemap: true
}
}
},
jshint: {
src: ['js/*.js']
},
watch: {
options: {
livereload: true
},
sass: {
files: ['sass/*.scss', 'sass/**/*.scss'],
tasks: ['compass', 'notify:sass'],
options: {
livereload: false
},
},
js: {
files: ['js/*.js'],
tasks: ['jshint', 'notify:js']
},
// php: {
// files: ['templates/*.php']
// },
css: {
files: ['css/*.css']
},
},
notify: {
js: {
options: {
//title: 'Task Complete', // optional
message: 'JSHint finished, no errors!' //required
}
},
sass: {
options: {
//title: 'Task Complete', // optional
message: 'SASS/Compass finished compiling!' //required
}
},
}
}); // end jSON
// Load plugins
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-notify');
// Default task(s)
grunt.registerTask('default', ['compass', 'watch']);
};
{
"name": "THEME_NAME",
"version": "0.1.0",
"devDependencies": {
"grunt": "latest",
"grunt-contrib-compass": "latest",
"grunt-contrib-watch": "latest",
"grunt-contrib-jshint": "latest",
"grunt-notify": "latest"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment