Skip to content
Merged
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
5 changes: 4 additions & 1 deletion lib/config/parse-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ module.exports = function(argv, cwd) {
runtimeConfig.verbose = true;

runtimeConfig.useDevServer = true;
runtimeConfig.devServerHttps = argv.https;
runtimeConfig.devServerKeepPublicPath = argv.keepPublicPath || false;

if (argv.https || argv.serverType === 'https') {
runtimeConfig.devServerHttps = true;
}

if (typeof argv.public === 'string') {
runtimeConfig.devServerPublic = argv.public;
}
Expand Down
12 changes: 11 additions & 1 deletion test/config/parse-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('parse-runtime', () => {
expect(config.environment).to.equal('dev');
expect(config.devServerHost).to.equal('foohost.l');
expect(config.devServerPort).to.equal(9999);
expect(config.devServerHttps).to.be.undefined;
expect(config.devServerHttps).to.be.null;
});

it('dev-server command https', () => {
Expand All @@ -93,6 +93,16 @@ describe('parse-runtime', () => {
expect(config.devServerHttps).to.equal(true);
});

it('dev-server command server-type https', () => {
const testDir = createTestDirectory();
const config = parseArgv(createArgv(['dev-server', '--server-type', 'https', '--host', 'foohost.l', '--port', '9999']), testDir);

expect(config.useDevServer).to.be.true;
expect(config.devServerHost).to.equal('foohost.l');
expect(config.devServerPort).to.equal(9999);
expect(config.devServerHttps).to.equal(true);
});

it('dev-server command public', () => {
const testDir = createTestDirectory();
const config = parseArgv(createArgv(['dev-server', '--public', 'https://my-domain:8080']), testDir);
Expand Down