mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-23 07:19:58 +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
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ScriptTarget } from 'typescript';
|
|
||||||
import * as webpack from 'webpack';
|
import * as webpack from 'webpack';
|
||||||
import { BuildBrowserFeatures } from '../../utils';
|
|
||||||
import { WebpackConfigOptions } from '../../utils/build-options';
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
||||||
import { CommonJsUsageWarnPlugin } from '../plugins';
|
import { CommonJsUsageWarnPlugin } from '../plugins';
|
||||||
import { getSourceMapDevTool } from '../utils/helpers';
|
import { getSourceMapDevTool } from '../utils/helpers';
|
||||||
@ -18,7 +16,6 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
|
|||||||
const {
|
const {
|
||||||
crossOrigin = 'none',
|
crossOrigin = 'none',
|
||||||
subresourceIntegrity,
|
subresourceIntegrity,
|
||||||
extractLicenses,
|
|
||||||
vendorChunk,
|
vendorChunk,
|
||||||
commonChunk,
|
commonChunk,
|
||||||
allowedCommonJsDependencies,
|
allowedCommonJsDependencies,
|
||||||
@ -59,8 +56,6 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
|
|||||||
crossOriginLoading = crossOrigin;
|
crossOriginLoading = crossOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildBrowserFeatures = new BuildBrowserFeatures(wco.projectRoot);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
devtool: false,
|
devtool: false,
|
||||||
resolve: {
|
resolve: {
|
||||||
|
@ -12,19 +12,13 @@ import { WebpackConfigOptions } from '../../utils/build-options';
|
|||||||
import { getTypescriptWorkerPlugin } from './typescript';
|
import { getTypescriptWorkerPlugin } from './typescript';
|
||||||
|
|
||||||
export function getWorkerConfig(wco: WebpackConfigOptions): Configuration {
|
export function getWorkerConfig(wco: WebpackConfigOptions): Configuration {
|
||||||
const { buildOptions } = wco;
|
const { webWorkerTsConfig } = wco.buildOptions;
|
||||||
|
|
||||||
if (!buildOptions.webWorkerTsConfig) {
|
if (!webWorkerTsConfig) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof buildOptions.webWorkerTsConfig != 'string') {
|
|
||||||
throw new Error('The `webWorkerTsConfig` must be a string.');
|
|
||||||
}
|
|
||||||
|
|
||||||
const workerTsConfigPath = resolve(wco.root, buildOptions.webWorkerTsConfig);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
plugins: [getTypescriptWorkerPlugin(wco, workerTsConfigPath)],
|
plugins: [getTypescriptWorkerPlugin(wco, resolve(wco.root, webWorkerTsConfig))],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user