Skip to content

Commit 885f360

Browse files
committed
add --inline-client command option to customize inline client url for livereload in webpack-dev-server
1 parent 457a6e0 commit 885f360

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/angular-cli/commands/serve.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface ServeTaskOptions {
3232
open?: boolean;
3333
vendorChunk?: boolean;
3434
hmr?: boolean;
35+
inlineClient?: string;
3536
}
3637

3738
const ServeCommand = Command.extend({
@@ -103,6 +104,12 @@ const ServeCommand = Command.extend({
103104
default: false,
104105
description: 'Enable hot module replacement',
105106
},
107+
{
108+
name: 'inline-client',
109+
type: String,
110+
aliases: ['ic'],
111+
description: '(Defaults to "http://host:port")'
112+
}
106113
],
107114

108115
run: function(commandOptions: ServeTaskOptions) {
@@ -116,6 +123,7 @@ const ServeCommand = Command.extend({
116123
}
117124

118125
commandOptions.liveReloadHost = commandOptions.liveReloadHost || commandOptions.host;
126+
commandOptions.inlineClient = commandOptions.inlineClient || `http://${commandOptions.host}:${commandOptions.port}/`;
119127

120128
return this._checkExpressPort(commandOptions)
121129
.then(this._autoFindLiveReloadPort.bind(this))

packages/angular-cli/tasks/serve-webpack.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ export default Task.extend({
3535
// This allows for live reload of page when changes are made to repo.
3636
// https://webpack.github.io/docs/webpack-dev-server.html#inline-mode
3737
let entryPoints = [
38-
`webpack-dev-server/client?http://${serveTaskOptions.host}:${serveTaskOptions.port}/`
38+
`webpack-dev-server/client?${serveTaskOptions.inlineClient}/`
3939
];
40+
4041
if (serveTaskOptions.hmr) {
4142
const webpackHmrLink = 'https://webpack.github.io/docs/hot-module-replacement.html';
4243
ui.writeLine(oneLine`

0 commit comments

Comments
 (0)