Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #905 from interactivellama/serve-all-the-things
Browse files Browse the repository at this point in the history
Allow multiple grunt projects to 'serve'
  • Loading branch information
Stephen Williams committed Dec 5, 2014
2 parents f84b067 + 7f2645f commit f824d54
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
module.exports = function(grunt) {
'use strict';

// use --no-livereload to disable livereload. Helpful to 'serve' multiple projects
var isLivereloadEnabled = (typeof grunt.option('livereload') !== 'undefined') ? grunt.option('livereload') : true;

// Project configuration.
grunt.initConfig({
// Metadata
Expand Down Expand Up @@ -113,13 +116,15 @@ module.exports = function(grunt) {
server: {
options: {
hostname: '*',
port: 8000
port: 8000,
useAvailablePort: true // increment port number, if unavailable...
}
},
testServer: {
options: {
hostname: '*',
port: 9000 // allows main server to be run simultaneously
port: 9000, // allows main server to be run simultaneously
useAvailablePort: true // increment port number, if unavailable...
}
}
},
Expand Down Expand Up @@ -309,21 +314,21 @@ module.exports = function(grunt) {
full: {
files: ['Gruntfile.js', 'fonts/**', 'js/**', 'less/**', 'lib/**', 'test/**', 'index.html', 'dev.html'],
options: {
livereload: true
livereload: isLivereloadEnabled
},
tasks: ['test', 'dist']
},
css: {
files: ['Gruntfile.js', 'fonts/**', 'js/**', 'less/**', 'lib/**', 'test/**', 'index.html', 'dev.html'],
options: {
livereload: true
livereload: isLivereloadEnabled
},
tasks: ['distcss']
},
contrib: {
files: ['Gruntfile.js', 'fonts/**', 'js/**', 'less/**', 'lib/**', 'test/**', 'index.html', 'dev.html'],
options: {
livereload: true
livereload: isLivereloadEnabled
},
tasks: ['test']
}
Expand Down

0 comments on commit f824d54

Please sign in to comment.