diff --git a/lib/utils/createConfig.js b/lib/utils/createConfig.js index 16ff397637..a696aacdb5 100644 --- a/lib/utils/createConfig.js +++ b/lib/utils/createConfig.js @@ -30,6 +30,10 @@ function createConfig(config, argv, { port }) { options.socket = argv.socket; } + if (argv.sockPath) { + options.sockPath = argv.sockPath; + } + if (argv.progress) { options.progress = argv.progress; } diff --git a/test/cli.test.js b/test/cli.test.js index 5d54f39447..83244797b9 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -71,6 +71,17 @@ describe('CLI', () => { .catch(done); }); + it('--sockPath', (done) => { + runDevServer('--sockPath /mysockPath') + .then((output) => { + expect( + output.stdout.includes('http://localhost&sockPath=/mysockPath') + ).toEqual(true); + done(); + }) + .catch(done); + }); + it('should exit the process when SIGINT is detected', (done) => { const cliPath = path.resolve(__dirname, '../bin/webpack-dev-server.js'); const examplePath = path.resolve(__dirname, '../examples/cli/public');