Skip to content

Commit

Permalink
feat: add --skip-host-check flag to start command (#717)
Browse files Browse the repository at this point in the history
  • Loading branch information
statm authored Apr 16, 2020
1 parent a763588 commit c97ca2b
Show file tree
Hide file tree
Showing 4 changed files with 714 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/haul-cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export default function startCommand(runtime: Runtime) {
default: 'false',
type: 'string',
},
'skip-host-check': {
description: 'Skips check for "index" or "host" bundle in Haul config',
default: 'false',
type: 'boolean',
},
'max-workers': {
description:
'Number of workers used to minify RAM bundle and load modules',
Expand All @@ -69,6 +74,7 @@ export default function startCommand(runtime: Runtime) {
config: string;
eager: string;
maxWorkers?: number;
skipHostCheck: boolean;
}>
) {
let parsedEager;
Expand Down Expand Up @@ -151,6 +157,7 @@ export default function startCommand(runtime: Runtime) {
eager: parsedEager,
platforms: projectConfig.platforms,
bundleNames: Object.keys(projectConfig.bundles),
skipHostCheck: argv.skipHostCheck,
}).listen(projectConfig.server.host, projectConfig.server.port);
} catch (error) {
runtime.logger.error('Command failed with error:', error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ module.exports = async function runWebpackCompiler({
);

const apps = [];
const bundles = sortBundlesByDependencies(projectConfig);
const bundles = sortBundlesByDependencies(projectConfig, {
skipHostCheck: configOptions.skipHostCheck,
});
let totalProgress = 0;
let bundlesBuilt = 0;

Expand Down
1 change: 1 addition & 0 deletions packages/haul-core/src/server/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ServerEnvOptions = Assign<
eager: string[];
bundleNames: string[];
platforms: string[];
skipHostCheck: boolean;
}
>;

Expand Down
Loading

0 comments on commit c97ca2b

Please sign in to comment.