Skip to content

Instantly share code, notes, and snippets.

@dehuszar
Last active August 29, 2015 14:15
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 dehuszar/c4e0abcd50c8c8e731c1 to your computer and use it in GitHub Desktop.
Save dehuszar/c4e0abcd50c8c8e731c1 to your computer and use it in GitHub Desktop.
Barebones Stylus Change Watcher
module.exports = function(grunt) {
grunt.initConfig({
watch: {
css: {
files: '**/*.styl',
tasks: ['stylus'],
options: {
livereload: true
}
}
},
stylus: {
compile: {
options: {
paths: ['/home/dehuszar/Development/v2.margueriteallen.com/wp-content/themes/mda-v2']
},
files: {
'/home/dehuszar/Development/v2.margueriteallen.com/wp-content/themes/mda-v2/app.css': '/home/dehuszar/Development/v2.margueriteallen.com/wp-content/themes/mda-v2/app.styl'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-stylus');
// Default task(s).
grunt.registerTask('default', ['stylus']);
}
/* in a new project folder, run the following:
* npm init
* npm install -g grunt-cli (if it's a new environment)
* npm install grunt --save-dev
* npm install grunt-contrib-stylus (or whatever pre-processor you need)
* npm install grunt-contrib-watch
*/
{
"name": "mda-resume-site",
"version": "0.1.0",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-stylus": "^0.20.0",
"grunt-contrib-watch": "^0.6.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment