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

Allow multiple grunt projects to 'serve' #905

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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