Skip to content

Commit a2bc175

Browse files
clydinalan-agius4
authored andcommitted
refactor(@angular-devkit/build-angular): remove Webpack loader resolve custom setting
The Webpack configuration setup previously walked up the directory structure to find all `node_modules` directories and then pass this list to Webpack's `resolverLoader.modules` option. This was previously done to ensure that hoisted packages were properly resolved. However, all loader paths are now fully resolved prior to being added to the Webpack configuration. Since loader paths will now be absolute, Webpack no longer needs to resolve them which makes the resolve settings no longer necessary.
1 parent 734d61d commit a2bc175

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

packages/angular_devkit/build_angular/src/utils/find-up.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/angular_devkit/build_angular/src/webpack/configs/common.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141
persistentBuildCacheEnabled,
4242
profilingEnabled,
4343
} from '../../utils/environment-options';
44-
import { findAllNodeModules } from '../../utils/find-up';
4544
import { Spinner } from '../../utils/spinner';
4645
import { addError } from '../../utils/webpack-diagnostics';
4746
import { DedupeModuleResolvePlugin, ScriptsWebpackPlugin } from '../plugins';
@@ -359,13 +358,6 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
359358
},
360359
resolveLoader: {
361360
symlinks: !buildOptions.preserveSymlinks,
362-
modules: [
363-
// Allow loaders to be in a node_modules nested inside the devkit/build-angular package.
364-
// This is important in case loaders do not get hoisted.
365-
// If this file moves to another location, alter potentialNodeModules as well.
366-
'node_modules',
367-
...findAllNodeModules(__dirname, projectRoot),
368-
],
369361
},
370362
context: root,
371363
entry: entryPoints,

0 commit comments

Comments
 (0)