Skip to content

Commit

Permalink
fix(@angular/cli): resolve in all available node_modules
Browse files Browse the repository at this point in the history
When @angular/cli dependencies (like @ngtool/webpack for example) are installed in its node_modules (as node_modules/@angular/cli/node_modules for example) webpack isn't seeing them.
  • Loading branch information
douglasduteil authored and hansl committed May 31, 2017
1 parent 0a6b796 commit be7a716
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
modules: ['node_modules', nodeModules],
},
resolveLoader: {
modules: [nodeModules]
modules: [nodeModules, 'node_modules']
},
context: projectRoot,
context: __dirname,
entry: entryPoints,
output: {
path: path.resolve(projectRoot, buildOptions.outputPath),
Expand Down
12 changes: 12 additions & 0 deletions tests/e2e/tests/misc/loaders-resolution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createDir, moveFile } from '../../utils/fs';
import { ng } from '../../utils/process';

export default async function () {
await createDir('node_modules/@angular/cli/node_modules');
await moveFile(
'node_modules/@ngtools',
'node_modules/@angular/cli/node_modules/@ngtools'
);

await ng('build');
}

0 comments on commit be7a716

Please sign in to comment.