angular/devtools/tools/dev-server/main.ts
AleksanderBodurri 445fbf81fd refactor(devtools): bring the angular devtools directory into the root bazel workspace
Previously devtools used a nested workspace for its bazel configurations. This meant framework dependencies were consumed via npm.

Now devtools is part of the root bazel directory that all other files in this codebase fall under. This allows us to build devtools using local angular packages, removing the need to consume these dependencies with npn. This is useful because we no longer have to update these dependencies with an automated tool like renovate, and our CI tests will always run against the most up to date framework packages.
2022-01-26 16:35:31 -05:00

31 lines
878 B
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import minimist from 'minimist';
import {DevServer} from './dev-server';
import {setupBazelWatcherSupport} from './ibazel';
const args = process.argv.slice(2);
const {
root_paths: _rootPathsRaw,
port,
historyApiFallback,
} = minimist(args, {boolean: 'historyApiFallback'});
const rootPaths = _rootPathsRaw ? _rootPathsRaw.split(',') : ['/'];
const bindUi = process.env.TEST_TARGET === undefined;
const server = new DevServer(port, rootPaths, bindUi, historyApiFallback);
// Setup ibazel support.
setupBazelWatcherSupport(server);
// Start the devserver. The server will always bind to the loopback and
// the public interface of the current host.
server.start();