Last active
August 29, 2015 14:03
-
-
Save carlos-reynosa/11f9c935aa74807762ab to your computer and use it in GitHub Desktop.
Grunt dependencies and tasks for running a php and livereload server in a project.
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
/** | |
* Tasks for running the php dev server and livereload server | |
* | |
*/ | |
module.exports = function(grunt){ | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
open:{ | |
dev:{ | |
path:'http://localhost:9000' | |
} | |
}, | |
shell:{ | |
/** | |
* Provides and easy server for development. | |
*/ | |
server:{ | |
command: 'php -S localhost:9000' | |
}, | |
/** | |
* Uses the node implementation of livereload for refreshing the browser. | |
*/ | |
livereload:{ | |
//Only look for changes in the newly regenerated blog in the public folder | |
command: 'livereloadx .' | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-shell'); | |
grunt.loadNpmTasks('grunt-open'); | |
grunt.registerTask('server',['open:dev','shell:server']); | |
grunt.registerTask('watch',['shell:livereload']); | |
}; |
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
{ | |
"name": "package-name", | |
"version": "0.0.0", | |
"description": "insert description", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Carlos E. Reynosa", | |
"license": "BSD-2-Clause", | |
"devDependencies": { | |
"grunt": "~0.4.5", | |
//For running shell tasks | |
"grunt-shell": "~0.7.0", | |
//for starting livereload server | |
"livereloadx": "~0.3.4", | |
"grunt-cli": "~0.1.13", | |
"grunt-open": "~0.2.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment