Skip to content

Commit 21ac631

Browse files
committed
Move config parsing to before pre-process args are set
Resolves bug where pre-process args won't get changed from cli values even if included in config
1 parent b14240f commit 21ac631

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/angular-http-server.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ var argv = require("minimist")(process.argv.slice(2));
1212
const getFilePathFromUrl = require('./get-file-path-from-url');
1313
const proxyHandler = require("./proxy");
1414

15-
// Pre-process arguments
16-
const useHttps = argv.ssl || argv.https;
17-
const basePath = argv.path ? path.resolve(argv.path) : process.cwd();
18-
const baseHref = argv.baseHref ? argv.baseHref : '';
19-
const rootFile = argv.rootFile ? argv.rootFile: 'index.html';
20-
const port = getPort(argv.p);
21-
22-
const NO_PATH_FILE_ERROR_MESSAGE =
23-
`Error: rootFile ${rootFile} could not be found in the specified path `;
24-
2515
// if using config file, load that first
2616
if (argv.config) {
2717
let configPath;
@@ -41,6 +31,16 @@ if (argv.config) {
4131
argv = Object.assign(config, argv);
4232
}
4333

34+
// Pre-process arguments
35+
const useHttps = argv.ssl || argv.https;
36+
const basePath = argv.path ? path.resolve(argv.path) : process.cwd();
37+
const baseHref = argv.baseHref || '';
38+
const rootFile = argv.rootFile || 'index.html';
39+
const port = getPort(argv.p);
40+
41+
const NO_PATH_FILE_ERROR_MESSAGE =
42+
`Error: rootFile ${rootFile} could not be found in the specified path `;
43+
4444
// As a part of the startup - check to make sure we can accessrootFile
4545
returnDistFile(true);
4646

0 commit comments

Comments
 (0)