Skip to content

Commit 44b3cc7

Browse files
clydinmgechev
authored andcommitted
feat(@angular-devkit/build-angular): provide webpack support for resolving via Yarn PnP
1 parent c8d5c3f commit 44b3cc7

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

packages/angular_devkit/build_angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"minimatch": "3.0.4",
4141
"parse5": "4.0.0",
4242
"open": "7.0.3",
43+
"pnp-webpack-plugin": "1.6.4",
4344
"postcss": "7.0.27",
4445
"postcss-import": "12.0.1",
4546
"postcss-loader": "3.0.0",

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import { getEsVersionForFileName, getOutputHashFormat, normalizeExtraEntryPoints
5050
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
5151
const CircularDependencyPlugin = require('circular-dependency-plugin');
5252
const TerserPlugin = require('terser-webpack-plugin');
53-
53+
const PnpWebpackPlugin = require('pnp-webpack-plugin');
5454

5555
// tslint:disable-next-line:no-big-function
5656
export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
@@ -491,10 +491,12 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
491491
symlinks: !buildOptions.preserveSymlinks,
492492
modules: [wco.tsConfig.options.baseUrl || projectRoot, 'node_modules'],
493493
alias,
494+
plugins: [PnpWebpackPlugin],
494495
},
495496
resolveLoader: {
496497
symlinks: !buildOptions.preserveSymlinks,
497498
modules: loaderNodeModules,
499+
plugins: [PnpWebpackPlugin.moduleLoader(module)],
498500
},
499501
context: projectRoot,
500502
entry: entryPoints,

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9103,6 +9103,13 @@ pluralize@^7.0.0:
91039103
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
91049104
integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==
91059105

9106+
9107+
version "1.6.4"
9108+
resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz#c9711ac4dc48a685dabafc86f8b6dd9f8df84149"
9109+
integrity sha512-7Wjy+9E3WwLOEL30D+m8TSTF7qJJUJLONBnwQp0518siuMxUQUbgZwssaFX+QKlZkjHZcw/IpZCt/H0srrntSg==
9110+
dependencies:
9111+
ts-pnp "^1.1.6"
9112+
91069113
popper.js@^1.14.1:
91079114
version "1.16.1"
91089115
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
@@ -11688,6 +11695,11 @@ ts-node@^5.0.0:
1168811695
source-map-support "^0.5.3"
1168911696
yn "^2.0.0"
1169011697

11698+
ts-pnp@^1.1.6:
11699+
version "1.2.0"
11700+
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
11701+
integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==
11702+
1169111703
[email protected], tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@~1.11.0:
1169211704
version "1.11.1"
1169311705
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"

0 commit comments

Comments
 (0)