Skip to content

Commit

Permalink
server - add a new "reload" task, prevent browser opening and force p…
Browse files Browse the repository at this point in the history
…ort to 35729

To trigger, use "yeoman server:reload"
  • Loading branch information
mklabs committed Aug 31, 2012
1 parent 1c1479b commit b427f31
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cli/tasks/server.js
Expand Up @@ -204,7 +204,12 @@ module.exports = function(grunt) {
// correct paths from config
app: path.resolve('app'),
dist: path.resolve('dist'),
test: path.resolve('test')
test: path.resolve('test'),

// reload is a special one, acting like `app` but not opening the HTTP
// server in default browser and forcing the port to LiveReload standard
// port.
reload: path.resolve('app')
};

target = target || 'app';
Expand All @@ -218,9 +223,11 @@ module.exports = function(grunt) {
}

grunt.helper('server', {
open: true,
port: port,
base: path.resolve(targets[target]),
// prevent browser opening on `reload` target
open: target !== 'reload',
// and force 35729 port no matter what when on `reload` target
port: target === 'reload' ? 35729 : port,
base: targets[target],
inject: true,
target: target
}, cb);
Expand Down

0 comments on commit b427f31

Please sign in to comment.