@jsenv/core 32.1.2 → 32.2.0

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
@@ -17152,6 +17152,7 @@ const addRelationshipWithPackageJson = ({
17152
17152
  * - "css_@import"
17153
17153
  * - "css_url"
17154
17154
  * - "js_import"
17155
+ * - "js_import_script"
17155
17156
  * - "js_url"
17156
17157
  * - "js_inline_content"
17157
17158
  * - "sourcemap_comment"
@@ -17187,7 +17188,7 @@ const jsenvPluginUrlResolution = ({
17187
17188
  "${urlType}" resolution key must be "web" or "node_esm", found "${Object.keys(rest)[0]}"`);
17188
17189
  }
17189
17190
  if (node_esm === undefined) {
17190
- node_esm = urlType === "js_module";
17191
+ node_esm = urlType === "js_import" || urlType === "js_import_script";
17191
17192
  }
17192
17193
  if (web === undefined) {
17193
17194
  web = true;
@@ -17229,13 +17230,17 @@ const jsenvPluginUrlResolution = ({
17229
17230
  if (reference.type === "sourcemap_comment") {
17230
17231
  return resolveUrlUsingWebResolution(reference);
17231
17232
  }
17232
- let urlType;
17233
+ let type;
17234
+ let subtype;
17235
+ const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl);
17233
17236
  if (reference.injected) {
17234
- urlType = reference.expectedType;
17237
+ type = reference.expectedType;
17238
+ subtype = reference.expectedSubtype;
17235
17239
  } else {
17236
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl);
17237
- urlType = parentUrlInfo ? parentUrlInfo.type : "entry_point";
17240
+ type = parentUrlInfo ? parentUrlInfo.type : "entry_point";
17241
+ subtype = parentUrlInfo ? parentUrlInfo.subtype : "";
17238
17242
  }
17243
+ const urlType = subtype === "self_import_scripts_arg" ? "js_import_script" : type;
17239
17244
  const resolver = resolvers[urlType] || resolvers["*"];
17240
17245
  return resolver(reference, context);
17241
17246
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "32.1.2",
3
+ "version": "32.2.0",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -21,6 +21,7 @@
21
21
  * - "css_@import"
22
22
  * - "css_url"
23
23
  * - "js_import"
24
+ * - "js_import_script"
24
25
  * - "js_url"
25
26
  * - "js_inline_content"
26
27
  * - "sourcemap_comment"
@@ -64,7 +65,7 @@ export const jsenvPluginUrlResolution = ({
64
65
  )
65
66
  }
66
67
  if (node_esm === undefined) {
67
- node_esm = urlType === "js_module"
68
+ node_esm = urlType === "js_import" || urlType === "js_import_script"
68
69
  }
69
70
  if (web === undefined) {
70
71
  web = true
@@ -106,13 +107,19 @@ export const jsenvPluginUrlResolution = ({
106
107
  if (reference.type === "sourcemap_comment") {
107
108
  return resolveUrlUsingWebResolution(reference, context)
108
109
  }
109
- let urlType
110
+
111
+ let type
112
+ let subtype
113
+ const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl)
110
114
  if (reference.injected) {
111
- urlType = reference.expectedType
115
+ type = reference.expectedType
116
+ subtype = reference.expectedSubtype
112
117
  } else {
113
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl)
114
- urlType = parentUrlInfo ? parentUrlInfo.type : "entry_point"
118
+ type = parentUrlInfo ? parentUrlInfo.type : "entry_point"
119
+ subtype = parentUrlInfo ? parentUrlInfo.subtype : ""
115
120
  }
121
+ const urlType =
122
+ subtype === "self_import_scripts_arg" ? "js_import_script" : type
116
123
  const resolver = resolvers[urlType] || resolvers["*"]
117
124
  return resolver(reference, context)
118
125
  },