mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 23:15:56 +08:00
refactor(@angular-devkit/build-angular): remove unused code in webpack configuration partials
Several unused imports and variables as well as redundant conditional checks were removed from the Webpack configuration partials.
This commit is contained in:
parent
38b01b9625
commit
bd9e3905b5
@ -6,9 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import { ScriptTarget } from 'typescript';
|
||||
import * as webpack from 'webpack';
|
||||
import { BuildBrowserFeatures } from '../../utils';
|
||||
import { WebpackConfigOptions } from '../../utils/build-options';
|
||||
import { CommonJsUsageWarnPlugin } from '../plugins';
|
||||
import { getSourceMapDevTool } from '../utils/helpers';
|
||||
@ -18,7 +16,6 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
|
||||
const {
|
||||
crossOrigin = 'none',
|
||||
subresourceIntegrity,
|
||||
extractLicenses,
|
||||
vendorChunk,
|
||||
commonChunk,
|
||||
allowedCommonJsDependencies,
|
||||
@ -59,8 +56,6 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
|
||||
crossOriginLoading = crossOrigin;
|
||||
}
|
||||
|
||||
const buildBrowserFeatures = new BuildBrowserFeatures(wco.projectRoot);
|
||||
|
||||
return {
|
||||
devtool: false,
|
||||
resolve: {
|
||||
|
@ -12,19 +12,13 @@ import { WebpackConfigOptions } from '../../utils/build-options';
|
||||
import { getTypescriptWorkerPlugin } from './typescript';
|
||||
|
||||
export function getWorkerConfig(wco: WebpackConfigOptions): Configuration {
|
||||
const { buildOptions } = wco;
|
||||
const { webWorkerTsConfig } = wco.buildOptions;
|
||||
|
||||
if (!buildOptions.webWorkerTsConfig) {
|
||||
if (!webWorkerTsConfig) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (typeof buildOptions.webWorkerTsConfig != 'string') {
|
||||
throw new Error('The `webWorkerTsConfig` must be a string.');
|
||||
}
|
||||
|
||||
const workerTsConfigPath = resolve(wco.root, buildOptions.webWorkerTsConfig);
|
||||
|
||||
return {
|
||||
plugins: [getTypescriptWorkerPlugin(wco, workerTsConfigPath)],
|
||||
plugins: [getTypescriptWorkerPlugin(wco, resolve(wco.root, webWorkerTsConfig))],
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user