@@ -12,6 +12,7 @@ import { isFile } from './fs';
12
12
13
13
/**
14
14
* Exception thrown when a module could not be resolved.
15
+ * @deprecated since version 8. Use `MODULE_NOT_FOUND` Node error code instead.
15
16
*/
16
17
export class ModuleNotFoundException extends BaseException {
17
18
public readonly code : string ;
@@ -70,6 +71,7 @@ function _getGlobalNodeModules() {
70
71
}
71
72
72
73
74
+ /** @deprecated since version 8. Use `require.resolve` instead. */
73
75
export interface ResolveOptions {
74
76
/**
75
77
* The basedir to use from which to resolve.
@@ -111,6 +113,7 @@ export interface ResolveOptions {
111
113
112
114
113
115
let _resolveHook : ( ( x : string , options : ResolveOptions ) => string | null ) | null = null ;
116
+ /** @deprecated since version 8. Use `require.resolve` instead. */
114
117
export function setResolveHook (
115
118
hook : ( ( x : string , options : ResolveOptions ) => string | null ) | null ,
116
119
) {
@@ -125,6 +128,7 @@ export function setResolveHook(
125
128
* @returns {string } Path to the index to include, or if `resolvePackageJson` option was
126
129
* passed, a path to that file.
127
130
* @throws {ModuleNotFoundException } If no module with that name was found anywhere.
131
+ * @deprecated since version 8. Use `require.resolve` instead.
128
132
*/
129
133
export function resolve ( packageName : string , options : ResolveOptions ) : string {
130
134
if ( _resolveHook ) {
0 commit comments