@jsenv/core 29.1.1 → 29.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -19837,8 +19837,19 @@ const jsenvPluginUrlResolution = ({
19837
19837
  return new URL(reference.specifier.slice(1), context.rootDirectoryUrl).href;
19838
19838
  }
19839
19839
 
19840
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl);
19841
- const urlType = parentUrlInfo ? parentUrlInfo.type : "entry_point";
19840
+ if (reference.type === "sourcemap_comment") {
19841
+ return resolveUrlUsingWebResolution(reference);
19842
+ }
19843
+
19844
+ let urlType;
19845
+
19846
+ if (reference.expectedType) {
19847
+ urlType = reference.expectedType;
19848
+ } else {
19849
+ const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl);
19850
+ urlType = parentUrlInfo ? parentUrlInfo.type : "entry_point";
19851
+ }
19852
+
19842
19853
  const resolver = resolvers[urlType] || resolvers["*"];
19843
19854
  return resolver(reference, context);
19844
19855
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "29.1.1",
3
+ "version": "29.1.2",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -98,8 +98,16 @@ export const jsenvPluginUrlResolution = ({
98
98
  return new URL(reference.specifier.slice(1), context.rootDirectoryUrl)
99
99
  .href
100
100
  }
101
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl)
102
- const urlType = parentUrlInfo ? parentUrlInfo.type : "entry_point"
101
+ if (reference.type === "sourcemap_comment") {
102
+ return resolveUrlUsingWebResolution(reference, context)
103
+ }
104
+ let urlType
105
+ if (reference.expectedType) {
106
+ urlType = reference.expectedType
107
+ } else {
108
+ const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl)
109
+ urlType = parentUrlInfo ? parentUrlInfo.type : "entry_point"
110
+ }
103
111
  const resolver = resolvers[urlType] || resolvers["*"]
104
112
  return resolver(reference, context)
105
113
  },