@marko/compiler 5.39.36 → 5.39.37

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.
@@ -308,10 +308,24 @@ function getMarkoFile(code, fileOpts, markoOpts) {
308
308
  const importNode = path.node;
309
309
  const scriptlet = importScriptlets.get(importNode);
310
310
  if (scriptlet) {
311
+ let hasTypes = false;
312
+ for (const specifier of path.get("specifiers")) {
313
+ if (
314
+ specifier.node.type === "ImportSpecifier" &&
315
+ specifier.node.importKind === "type")
316
+ {
317
+ hasTypes = true;
318
+ specifier.remove();
319
+ }
320
+ }
321
+
311
322
  path.remove();
323
+
312
324
  // Add back imports from scriptlets that were
313
325
  // hoisted for the babel typescript transform.
314
- scriptlet.body.unshift(importNode);
326
+ if (!hasTypes || importNode.specifiers.length) {
327
+ scriptlet.body.unshift(importNode);
328
+ }
315
329
  }
316
330
  }
317
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.39.36",
3
+ "version": "5.39.37",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",
@@ -87,7 +87,7 @@
87
87
  "source-map-support": "^0.5.21"
88
88
  },
89
89
  "devDependencies": {
90
- "marko": "^5.37.56"
90
+ "marko": "^5.37.57"
91
91
  },
92
92
  "engines": {
93
93
  "node": "18 || 20 || >=22"