@ms-cloudpack/import-map
Advanced tools
Comparing version 0.5.16 to 0.5.17
@@ -36,11 +36,17 @@ import { getExportsMap, isExternalPackage } from '@ms-cloudpack/package-utilities'; | ||
const exportsMap = await getExportsMap({ packagePath: entry.path }, { packages, config }); | ||
if (!definition || | ||
!definition.version || | ||
!exportsMap || | ||
Object.keys(exportsMap).length === 0 || | ||
name.startsWith('@types/')) { | ||
if (!definition || !definition.version || name.startsWith('@types/')) { | ||
return importMap; | ||
} | ||
const noExportsMap = !exportsMap || Object.keys(exportsMap).length === 0; | ||
const packagePrefix = `${name}@${entry.version}/`; | ||
const baseUrl = `${urls.bundleServer}/${packagePrefix}`; | ||
// If the package has no exports map, we can't generate an import map for it. | ||
if (noExportsMap) { | ||
// Except for when autoUpdateEntries is enabled, in which case we can add a fallback | ||
// so we can add entries to the exports map later. | ||
if (config.features?.autoUpdateEntries && importMap[definition.name + '/'] === undefined) { | ||
importMap[definition.name + '/'] = baseUrl + 'missing/'; | ||
} | ||
return importMap; | ||
} | ||
const isExternal = isExternalPackage(entry.path); | ||
@@ -47,0 +53,0 @@ const targetVersion = targetVersions?.[entry.path]; |
{ | ||
"name": "@ms-cloudpack/import-map", | ||
"version": "0.5.16", | ||
"version": "0.5.17", | ||
"description": "Utilities for creating/updating import maps.", | ||
@@ -17,6 +17,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@ms-cloudpack/common-types": "^0.8.2", | ||
"@ms-cloudpack/package-utilities": "^7.7.0", | ||
"@ms-cloudpack/common-types": "^0.9.0", | ||
"@ms-cloudpack/package-utilities": "^7.7.1", | ||
"@ms-cloudpack/path-string-parsing": "^1.2.3", | ||
"@ms-cloudpack/path-utilities": "^2.7.20", | ||
"@ms-cloudpack/path-utilities": "^2.7.21", | ||
"merge": "^2.1.1" | ||
@@ -23,0 +23,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
48549
413
+ Added@ms-cloudpack/common-types@0.9.0(transitive)
- Removed@ms-cloudpack/common-types@0.8.2(transitive)