Skip to content

Commit

Permalink
Merge branch 'master' into universal-inline
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrawlings committed Apr 17, 2019
2 parents 6bb5d5b + 58d1682 commit bf5adc2
Show file tree
Hide file tree
Showing 8 changed files with 381 additions and 946 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ client
coverage
ssl/*.pem
node_modules
.vscode
6 changes: 4 additions & 2 deletions client-src/default/index.js
Expand Up @@ -221,12 +221,14 @@ if (
) {
protocol = self.location.protocol;
}

const socketUrl = url.format({
protocol,
auth: urlParts.auth,
hostname,
port,
port:
urlParts.path == null || urlParts.path === '/'
? port
: querystring.parse(urlParts.path).sockPort || port,
// If sockPath is provided it'll be passed in via the __resourceQuery as a
// query param so it has to be parsed out of the querystring in order for the
// client to open the socket to the correct location.
Expand Down
13 changes: 13 additions & 0 deletions lib/options.json
Expand Up @@ -67,6 +67,19 @@
"sockPath": {
"type": "string"
},
"sockPort": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
]
},
"watchOptions": {
"type": "object"
},
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/addEntries.js
Expand Up @@ -17,9 +17,10 @@ function addEntries(config, options, server) {

const domain = createDomain(options, app);
const sockPath = options.sockPath ? `&sockPath=${options.sockPath}` : '';
const sockPort = options.sockPort ? `&sockPort=${options.sockPort}` : '';
const clientEntry = `${require.resolve(
'../../client/'
)}?${domain}${sockPath}`;
)}?${domain}${sockPath}${sockPort}`;
let hotEntry;

if (options.hotOnly) {
Expand Down
4 changes: 4 additions & 0 deletions lib/utils/createConfig.js
Expand Up @@ -30,6 +30,10 @@ function createConfig(config, argv, { port }) {
options.socket = argv.socket;
}

if (argv.sockPort) {
options.sockPort = argv.sockPort;
}

if (argv.progress) {
options.progress = argv.progress;
}
Expand Down

0 comments on commit bf5adc2

Please sign in to comment.