Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
}
const normalizedOptimization = normalizeOptimization(browserOptions.optimization);
if (normalizedOptimization.scripts || normalizedOptimization.styles) {
context.logger.error(tags.stripIndents`
****************************************************************************************
This is a simple server for use in testing or debugging Angular applications locally.
It hasn't been reviewed for security issues.
DON'T USE IT FOR PRODUCTION!
****************************************************************************************
`);
}
return runWebpackDevServer(webpackConfig, context, { logging: loggingFn }).pipe(
map(buildEvent => {
// Resolve serve address.
const serverAddress = url.format({
protocol: options.ssl ? 'https' : 'http',
hostname: options.host === '0.0.0.0' ? 'localhost' : options.host,
pathname: webpackDevServerConfig.publicPath,
port: buildEvent.port,
});
if (first) {
first = false;
context.logger.info(tags.oneLine`
**
Angular Live Development Server is listening on ${options.host}:${buildEvent.port},
open your browser on ${serverAddress}
**
);
}
const normalizedOptimization = normalizeOptimization(browserOptions.optimization);
if (normalizedOptimization.scripts || normalizedOptimization.styles) {
context.logger.error(tags.stripIndents`
****************************************************************************************
This is a simple server for use in testing or debugging Angular applications locally.
It hasn't been reviewed for security issues.
DON'T USE IT FOR PRODUCTION!
****************************************************************************************
`);
}
return runWebpackDevServer(
webpackConfig,
context,
{
logging: loggingFn,
webpackFactory: require('webpack') as typeof webpack,
webpackDevServerFactory: require('webpack-dev-server') as typeof WebpackDevServer,
},
).pipe(
map(buildEvent => {
// Resolve serve address.
const serverAddress = url.format({
protocol: options.ssl ? 'https' : 'http',
hostname: options.host === '0.0.0.0' ? 'localhost' : options.host,
pathname: webpackDevServerConfig.publicPath,
port: buildEvent.port,
});
switchMap(([config, options, serverUrl]) => {
return runWebpackDevServer(config, context, {
logging: stats => {
context.logger.info(stats.toString(config.stats));
}
}).pipe(
map(output => {
output.baseUrl = serverUrl;
return output;
})
);
})
);
switchMap(([config, options, serverUrl]) => {
return runWebpackDevServer(config, context, {
logging: stats => {
context.logger.info(stats.toString(config.stats));
},
webpackFactory: require('webpack'),
webpackDevServerFactory: require('webpack-dev-server')
}).pipe(
map(output => {
output.baseUrl = serverUrl;
return output;
})
);
})
);