Last active
August 29, 2015 14:02
-
-
Save crishushu/a85fba64906e52c40520 to your computer and use it in GitHub Desktop.
Gruntjs: Skeleton for client-side debugging
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) { | |
| grunt.initConfig({ | |
| npmEnv: '', // path to node_modules folder | |
| debugPort: '', // debugger port | |
| connectPort: , // connector port 35725 | |
| base: '.', // path to index | |
| watch: { | |
| refresh: { | |
| options: { | |
| livereload: '<%= connect.options.livereload %>' | |
| }, | |
| files: ['<%= base %>/**/*.js' // files to monitor | |
| ] | |
| } | |
| }, | |
| connect: { | |
| options: { | |
| port: '<%= debugPort %>', | |
| hostname: 'localhost', | |
| livereload: '<%= connectPort %>' | |
| }, | |
| browser: { | |
| options: { | |
| open: true, | |
| base: ['.tmp', '<%= base %>'] | |
| } | |
| } | |
| } | |
| }); | |
| var NPM_ENV = grunt.config.get('npmEnv'); | |
| require(NPM_ENV + 'grunt-contrib-connect/tasks/connect')(grunt); | |
| require(NPM_ENV + 'grunt-contrib-watch/tasks/watch')(grunt); | |
| grunt.registerTask('serve', ['connect:browser', 'watch:refresh']); | |
| grunt.registerTask('default', ['serve']); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment