Home > @rushstack/node-core-library > IImportResolveOptions > allowSelfReference
IImportResolveOptions.allowSelfReference property
If true, then resolvePath is allowed to refer to the package.json of the active project.
Signature:
allowSelfReference?: boolean;
Remarks
This will take precedence over any installed dependency with the same name. Note that this requires an additional PackageJsonLookup calculation.
Example:
// Returns an absolute path to the current package
Import.resolveModulePath({
resolvePath: "current-project",
basePath: process.cwd(),
allowSelfReference: true
})