Skip to content
Closed
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion packages/angular-cli/commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface ServeTaskOptions {
i18nFile?: string;
i18nFormat?: string;
locale?: string;
inlineClient?: string;
}

const ServeCommand = Command.extend({
Expand Down Expand Up @@ -109,7 +110,13 @@ const ServeCommand = Command.extend({
},
{ name: 'i18n-file', type: String, default: null },
{ name: 'i18n-format', type: String, default: null },
{ name: 'locale', type: String, default: null }
{ name: 'locale', type: String, default: null },
{
name: 'inline-client',
type: String,
aliases: ['ic'],
description: 'Websocket client URL for Webpack inline mode (Defaults to "http://host:port")'
}
],

run: function(commandOptions: ServeTaskOptions) {
Expand All @@ -126,6 +133,9 @@ const ServeCommand = Command.extend({
Version.assertAngularVersionIs2_3_1OrHigher(this.project.root);
commandOptions.liveReloadHost = commandOptions.liveReloadHost || commandOptions.host;

commandOptions.inlineClient = commandOptions.inlineClient ||
`http://${commandOptions.host}:${commandOptions.port}/`;

return this._checkExpressPort(commandOptions)
.then(this._autoFindLiveReloadPort.bind(this))
.then((opts: ServeTaskOptions) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/angular-cli/tasks/serve-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ export default Task.extend({
// This allows for live reload of page when changes are made to repo.
// https://webpack.github.io/docs/webpack-dev-server.html#inline-mode
let entryPoints = [
`webpack-dev-server/client?http://${serveTaskOptions.host}:${serveTaskOptions.port}/`
`webpack-dev-server/client?${serveTaskOptions.inlineClient}/`
];

if (serveTaskOptions.hmr) {
const webpackHmrLink = 'https://webpack.github.io/docs/hot-module-replacement.html';
ui.writeLine(oneLine`
Expand Down