Skip to content

Commit e991ad8

Browse files
Revert removing public option
1 parent 9e1528e commit e991ad8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

bin/encore.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if (runtimeConfig.outputJson) {
3030
process.argv.splice(2, 1);
3131

3232
// remove arguments not supported by webpack/-dev-server
33-
const encoreOnlyArguments = new Set(['--keep-public-path']);
33+
const encoreOnlyArguments = new Set(['--keep-public-path', '--public']);
3434
process.argv = process.argv.filter(arg => !encoreOnlyArguments.has(arg));
3535

3636
if (!runtimeConfig.isValidCommand) {
@@ -78,6 +78,7 @@ function showUsageInstructions() {
7878
console.log(` - ${chalk.yellow('--host')} The hostname/ip address the webpack-dev-server will bind to`);
7979
console.log(` - ${chalk.yellow('--port')} The port the webpack-dev-server will bind to`);
8080
console.log(` - ${chalk.yellow('--keep-public-path')} Do not change the public path (it is usually prefixed by the dev server URL)`);
81+
console.log(` - ${chalk.yellow('--public')} The public url for entry asset in entrypoints.json`);
8182
console.log(' - Supports any webpack-dev-server options');
8283
console.log();
8384
console.log(` ${chalk.green('production')} : runs webpack for production`);

lib/config/parse-runtime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ module.exports = function(argv, cwd) {
4444
runtimeConfig.devServerHttps = argv.https;
4545
runtimeConfig.devServerKeepPublicPath = argv.keepPublicPath || false;
4646

47-
if (typeof argv['client-web-socket-url'] === 'string') {
48-
runtimeConfig.devServerPublic = argv['client-web-socket-url'];
47+
if (typeof argv.public === 'string') {
48+
runtimeConfig.devServerPublic = argv.public;
4949
}
5050

5151
runtimeConfig.devServerHost = argv.host ? argv.host : 'localhost';

test/config/parse-runtime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ describe('parse-runtime', () => {
9393
expect(config.devServerHttps).to.equal(true);
9494
});
9595

96-
it('dev-server command client-web-socket-url', () => {
96+
it('dev-server command public', () => {
9797
const testDir = createTestDirectory();
98-
const config = parseArgv(createArgv(['dev-server', '--client-web-socket-url', 'https://my-domain:8080']), testDir);
98+
const config = parseArgv(createArgv(['dev-server', '--public', 'https://my-domain:8080']), testDir);
9999

100100
expect(config.devServerPublic).to.equal('https://my-domain:8080');
101101
});

0 commit comments

Comments
 (0)