Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 8c88308

Browse files
clydinfilipesilva
authored andcommitted
refactor(@angular-devkit/build-angular): remove several unneeded deps
1 parent 124beeb commit 8c88308

File tree

5 files changed

+4
-18
lines changed

5 files changed

+4
-18
lines changed

packages/angular_devkit/build_angular/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"ajv": "~6.4.0",
1717
"autoprefixer": "^8.4.1",
1818
"cache-loader": "^1.2.2",
19-
"chalk": "~2.2.2",
2019
"circular-dependency-plugin": "^5.0.2",
2120
"clean-css": "^4.1.11",
2221
"copy-webpack-plugin": "^4.5.1",
@@ -29,7 +28,6 @@
2928
"less": "^3.0.4",
3029
"less-loader": "^4.1.0",
3130
"license-webpack-plugin": "^1.3.1",
32-
"lodash": "^4.17.4",
3331
"memory-fs": "^0.4.1",
3432
"mini-css-extract-plugin": "~0.4.0",
3533
"minimatch": "^3.0.4",
@@ -41,10 +39,8 @@
4139
"postcss-loader": "^2.1.5",
4240
"postcss-url": "^7.3.2",
4341
"raw-loader": "^0.5.1",
44-
"resolve": "^1.5.0",
4542
"rxjs": "^6.0.0",
4643
"sass-loader": "^7.0.1",
47-
"silent-error": "^1.1.0",
4844
"source-map-support": "^0.5.0",
4945
"stats-webpack-plugin": "^0.6.2",
5046
"style-loader": "^0.21.0",

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin');
2626
const CircularDependencyPlugin = require('circular-dependency-plugin');
2727
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
2828
const StatsPlugin = require('stats-webpack-plugin');
29-
const SilentError = require('silent-error');
30-
const resolve = require('resolve');
3129

3230
/**
3331
* Enumerate loaders and their dependencies from this file to let the dependency validator
@@ -166,7 +164,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
166164
// Set the cache directory to the Build Optimizer dir, so that package updates will delete it.
167165
const buildOptimizerDir = g['_DevKitIsLocal']
168166
? nodeModules
169-
: path.dirname(resolve.sync('@angular-devkit/build-optimizer', { basedir: projectRoot }));
167+
: path.dirname(require.resolve('@angular-devkit/build-optimizer', { paths: [projectRoot] }));
170168
const cacheDirectory = path.resolve(buildOptimizerDir, './.cache/');
171169

172170
buildOptimizerUseRule = {

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/typescript.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import {
1818
import { buildOptimizerLoader } from './common';
1919
import { WebpackConfigOptions } from '../build-options';
2020

21-
const SilentError = require('silent-error');
22-
2321

2422
const g: any = typeof global !== 'undefined' ? global : {};
2523
const webpackLoader: string = g['_DevKitIsLocal']

packages/angular_devkit/build_angular/src/angular-cli-files/utilities/require-project-module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
// tslint:disable
99
// TODO: cleanup this file, it's copied as is from Angular CLI.
1010

11-
const resolve = require('resolve');
1211

1312
// Resolve dependencies within the target project.
1413
export function resolveProjectModule(root: string, moduleName: string) {
15-
return resolve.sync(moduleName, { basedir: root });
14+
return require.resolve(moduleName, { paths: [root] });
1615
}
1716

1817
// Require dependencies within the target project.

packages/angular_devkit/build_angular/src/angular-cli-files/utilities/stats.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,10 @@
77
*/
88
// tslint:disable
99
// TODO: cleanup this file, it's copied as is from Angular CLI.
10+
import { tags, terminal } from '@angular-devkit/core';
1011

11-
import chalk from 'chalk';
12-
import { tags } from '@angular-devkit/core';
1312

14-
15-
// Force basic color support on terminals with no color support.
16-
// Chalk typings don't have the correct constructor parameters.
17-
const chalkCtx = new (chalk.constructor as any)(chalk.supportsColor ? {} : { level: 1 });
18-
const { bold, green, red, reset, white, yellow } = chalkCtx;
13+
const { bold, green, red, reset, white, yellow } = terminal;
1914

2015
export function formatSize(size: number): string {
2116
if (size <= 0) {

0 commit comments

Comments
 (0)