@@ -12,6 +12,7 @@ import { isFile } from './fs';
1212
1313/**
1414 * Exception thrown when a module could not be resolved.
15+ * @deprecated since version 8. Use `MODULE_NOT_FOUND` Node error code instead.
1516 */
1617export class ModuleNotFoundException extends BaseException {
1718 public readonly code : string ;
@@ -70,6 +71,7 @@ function _getGlobalNodeModules() {
7071}
7172
7273
74+ /** @deprecated since version 8. Use `require.resolve` instead. */
7375export interface ResolveOptions {
7476 /**
7577 * The basedir to use from which to resolve.
@@ -111,6 +113,7 @@ export interface ResolveOptions {
111113
112114
113115let _resolveHook : ( ( x : string , options : ResolveOptions ) => string | null ) | null = null ;
116+ /** @deprecated since version 8. Use `require.resolve` instead. */
114117export function setResolveHook (
115118 hook : ( ( x : string , options : ResolveOptions ) => string | null ) | null ,
116119) {
@@ -125,6 +128,7 @@ export function setResolveHook(
125128 * @returns {string } Path to the index to include, or if `resolvePackageJson` option was
126129 * passed, a path to that file.
127130 * @throws {ModuleNotFoundException } If no module with that name was found anywhere.
131+ * @deprecated since version 8. Use `require.resolve` instead.
128132 */
129133export function resolve ( packageName : string , options : ResolveOptions ) : string {
130134 if ( _resolveHook ) {
0 commit comments