esm-resolve
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -19,5 +19,7 @@ /* | ||
import {ResolverOptions} from './types/index.js'; | ||
/** | ||
* Builds an import resolver for the given importer file. | ||
*/ | ||
export default function buildResolver(importer: string, options?: Partial<types.ResolverOptions>): (importer: string) => string|undefined; | ||
export default function buildResolver(importer: string, options?: Partial<ResolverOptions>): (importer: string) => string|undefined; |
@@ -23,2 +23,6 @@ /* | ||
// TODO(samthor): This includes 'module' to work around a problem in a certain popular JS library. | ||
const alwaysConstraints = ['module', 'import']; | ||
/** | ||
@@ -78,3 +82,3 @@ * @param {types.InternalPackageModuleNode} exports | ||
for (const key in node) { | ||
if (key === 'import' || constraints.includes(key)) { | ||
if (alwaysConstraints.includes(key) || constraints.includes(key)) { | ||
node = node[key]; | ||
@@ -81,0 +85,0 @@ continue restart; |
{ | ||
"name": "esm-resolve", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Resolves ESM imports in JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -65,2 +65,4 @@ /* | ||
* main field even if the package type is not "module". Defaults to true. | ||
* | ||
* @default true | ||
*/ | ||
@@ -67,0 +69,0 @@ includeMainFallback: boolean, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31260
542