Skip to content

Commit bfc6b68

Browse files
committed
refactor(@angular-devkit/core): use standard node resolution methods where possible
1 parent 1dca833 commit bfc6b68

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/angular_devkit/core/node/experimental/jobs/job-registry.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,19 @@
77
*/
88
import { Observable, of } from 'rxjs';
99
import { JsonValue, experimental as core_experimental, schema } from '../../../src';
10-
import { ModuleNotFoundException, resolve } from '../../resolve';
1110

1211
export class NodeModuleJobRegistry<MinimumArgumentValueT extends JsonValue = JsonValue,
1312
MinimumInputValueT extends JsonValue = JsonValue,
1413
MinimumOutputValueT extends JsonValue = JsonValue,
1514
> implements core_experimental.jobs.Registry<MinimumArgumentValueT,
1615
MinimumInputValueT,
1716
MinimumOutputValueT> {
18-
public constructor(private _resolveLocal = true, private _resolveGlobal = false) {
19-
}
2017

2118
protected _resolve(name: string): string | null {
2219
try {
23-
return resolve(name, {
24-
checkLocal: this._resolveLocal,
25-
checkGlobal: this._resolveGlobal,
26-
basedir: __dirname,
27-
});
20+
return require.resolve(name);
2821
} catch (e) {
29-
if (e instanceof ModuleNotFoundException) {
22+
if (e.code === 'MODULE_NOT_FOUND') {
3023
return null;
3124
}
3225
throw e;

0 commit comments

Comments
 (0)