Last active
August 29, 2015 14:10
-
-
Save teone/64c2640c61461351abb2 to your computer and use it in GitHub Desktop.
Basic Grunt configuration for compass and livereload
This file contains hidden or 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) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| watch: { | |
| scripts: { | |
| files: ['sass/*.scss'], | |
| tasks: ['compass'], | |
| options: { | |
| livereload: true, | |
| }, | |
| }, | |
| livereload: { | |
| options: { | |
| livereload: '<%= connect.options.livereload %>' | |
| }, | |
| files: [ | |
| '*.html', | |
| 'images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' | |
| ] | |
| }, | |
| }, | |
| compass: { | |
| dist: { | |
| options: { // Target options | |
| sassDir: 'sass', | |
| cssDir: 'css', | |
| environment: 'development' | |
| } | |
| } | |
| }, | |
| connect: { | |
| options: { | |
| port: 9000, | |
| // Change this to '0.0.0.0' to access the server from outside. | |
| hostname: 'localhost', | |
| livereload: 35729 | |
| }, | |
| livereload: { | |
| options: { | |
| open: 'http://127.0.0.1:9000', | |
| } | |
| } | |
| }, | |
| }); | |
| grunt.loadNpmTasks('grunt-contrib-watch'); | |
| grunt.loadNpmTasks('grunt-contrib-compass'); | |
| grunt.loadNpmTasks('grunt-contrib-connect'); | |
| grunt.registerTask('serve', [ | |
| 'connect', | |
| 'watch' | |
| ]); | |
| }; |
This file contains hidden or 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": "BasicGrunt", | |
| "version": "1.0.0", | |
| "description": "Basic Grunt", | |
| "main": "index.html", | |
| "author": "Matteo Scandolo", | |
| "devDependencies": { | |
| "grunt": "^0.4.5", | |
| "grunt-contrib-compass": "^1.0.1", | |
| "grunt-contrib-connect": "^0.9.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