for setting up grunt, see: http://gruntjs.com/getting-started
Created
October 26, 2014 13:43
-
-
Save jaeming/6942acc103131f30a5b5 to your computer and use it in GitHub Desktop.
Gruntfile for simple haml to html
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
module.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-haml'); | |
grunt.initConfig({ | |
uglify: { | |
my_target: { | |
files: { | |
'js/script.js': ['javascripts/*.js'] | |
} //files | |
} //my_target | |
}, //uglify | |
sass: { | |
dist: { | |
options: { | |
sourcemap: true, | |
compass: true | |
}, //options | |
files:{ | |
'stylesheets/style.css': 'sass/style.scss' | |
} //files | |
} //dist | |
}, //sass | |
haml: { // Task | |
dist: { // Target | |
files: { // Dictionary of files | |
'index.html': 'index.haml' // 'destination': 'source' | |
} | |
} | |
}, | |
watch: { | |
options: { livereload: true }, | |
scripts: { | |
files: ['javascripts/*.js'], | |
tasks: ['uglify'] | |
}, //script | |
css: { | |
files: ['sass/*.scss'], | |
tasks: ['sass'] | |
}, //sass | |
html: { | |
files: ['*.haml'], | |
task: ['haml'] | |
} | |
} //watch | |
}) //initConfig | |
grunt.registerTask('default', ['haml', 'watch']); | |
} //exports |
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
{ | |
"engines": { | |
"node": ">= 0.10.0" | |
}, | |
"devDependencies": { | |
"grunt": "~0.4.5", | |
"grunt-contrib-jshint": "~0.10.0", | |
"grunt-contrib-watch": "~0.6.1", | |
"grunt-contrib-qunit": "~0.5.2", | |
"grunt-contrib-concat": "~0.4.0", | |
"grunt-contrib-uglify": "~0.5.0", | |
"grunt-contrib-haml": "~0.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment