@ngtools/webpack 14.0.4 → 14.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ngcc_processor.d.ts +1 -1
- package/src/ngcc_processor.js +10 -6
package/package.json
CHANGED
package/src/ngcc_processor.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare class NgccProcessor {
|
|
|
24
24
|
constructor(compilerNgcc: typeof import('@angular/compiler-cli/ngcc'), propertiesToConsider: string[], compilationWarnings: (Error | string)[], compilationErrors: (Error | string)[], basePath: string, tsConfigPath: string, inputFileSystem: InputFileSystem, resolver: ResolverWithOptions);
|
|
25
25
|
/** Process the entire node modules tree. */
|
|
26
26
|
process(): void;
|
|
27
|
-
/** Process a module and
|
|
27
|
+
/** Process a module and its dependencies. */
|
|
28
28
|
processModule(moduleName: string, resolvedModule: ts.ResolvedModule | ts.ResolvedTypeReferenceDirective): void;
|
|
29
29
|
invalidate(fileName: string): void;
|
|
30
30
|
/**
|
package/src/ngcc_processor.js
CHANGED
|
@@ -59,8 +59,10 @@ class NgccProcessor {
|
|
|
59
59
|
}
|
|
60
60
|
/** Process the entire node modules tree. */
|
|
61
61
|
process() {
|
|
62
|
-
// Under Bazel when running in sandbox mode parts of the filesystem is read-only
|
|
63
|
-
|
|
62
|
+
// Under Bazel when running in sandbox mode parts of the filesystem is read-only, or when using
|
|
63
|
+
// Yarn PnP there may not be a node_modules directory. ngcc can't run in those cases, so the
|
|
64
|
+
// processing is skipped.
|
|
65
|
+
if (process.env.BAZEL_TARGET || !this._nodeModulesDirectory) {
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
68
|
// Skip if node_modules are read-only
|
|
@@ -154,14 +156,16 @@ class NgccProcessor {
|
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
|
-
/** Process a module and
|
|
159
|
+
/** Process a module and its dependencies. */
|
|
158
160
|
processModule(moduleName, resolvedModule) {
|
|
159
161
|
var _a, _b;
|
|
160
162
|
const resolvedFileName = resolvedModule.resolvedFileName;
|
|
161
|
-
if (!
|
|
163
|
+
if (!this._nodeModulesDirectory ||
|
|
164
|
+
!resolvedFileName ||
|
|
162
165
|
moduleName.startsWith('.') ||
|
|
163
166
|
this._processedModules.has(resolvedFileName)) {
|
|
164
|
-
// Skip when
|
|
167
|
+
// Skip when module_modules directory is not present, module is unknown, relative or the
|
|
168
|
+
// NGCC compiler is not found or already processed.
|
|
165
169
|
return;
|
|
166
170
|
}
|
|
167
171
|
const packageJsonPath = this.tryResolvePackage(moduleName, resolvedFileName);
|
|
@@ -216,7 +220,7 @@ class NgccProcessor {
|
|
|
216
220
|
}
|
|
217
221
|
current = path.dirname(current);
|
|
218
222
|
}
|
|
219
|
-
|
|
223
|
+
return null;
|
|
220
224
|
}
|
|
221
225
|
findPackageManagerLockFile(projectBasePath) {
|
|
222
226
|
for (const lockFile of ['yarn.lock', 'pnpm-lock.yaml', 'package-lock.json']) {
|