@marko/vite 4.1.11 → 4.1.13

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.
Files changed (2) hide show
  1. package/dist/index.mjs +17 -16
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -4,7 +4,6 @@ import path5 from "path";
4
4
  import crypto from "crypto";
5
5
  import anyMatch from "anymatch";
6
6
  import { pathToFileURL } from "url";
7
- import { transform as cjsToEsm } from "@chialab/cjs-to-esm";
8
7
 
9
8
  // src/server-entry-template.ts
10
9
  import path from "path";
@@ -663,8 +662,8 @@ var babelCaller = {
663
662
  supportsTopLevelAwait: true,
664
663
  supportsExportNamespaceFrom: true
665
664
  };
666
- var optimizedRegistryIds = /* @__PURE__ */ new Map();
667
665
  var registeredTagLib = false;
666
+ var cjsToEsm;
668
667
  function markoPlugin(opts = {}) {
669
668
  let compiler;
670
669
  let { linked = true } = opts;
@@ -727,7 +726,8 @@ function markoPlugin(opts = {}) {
727
726
  baseConfig = {
728
727
  cache,
729
728
  optimize,
730
- optimizedRegistryIds: optimize && linked ? optimizedRegistryIds : void 0,
729
+ // optimizedRegistryIds:
730
+ // optimize && linked ? optimizedRegistryIds : undefined,
731
731
  runtimeId,
732
732
  sourceMaps: true,
733
733
  writeVersionComment: false,
@@ -946,14 +946,6 @@ function markoPlugin(opts = {}) {
946
946
  if (isBuild && linked && !isSSRBuild) {
947
947
  try {
948
948
  serverManifest = await store.read();
949
- if (serverManifest.optimizedRegistryIds) {
950
- for (const id in serverManifest.optimizedRegistryIds) {
951
- optimizedRegistryIds.set(
952
- id,
953
- serverManifest.optimizedRegistryIds[id]
954
- );
955
- }
956
- }
957
949
  inputOptions.input = toHTMLEntries(root, serverManifest.entries);
958
950
  for (const entry in serverManifest.entrySources) {
959
951
  const id = normalizePath(path5.resolve(root, entry));
@@ -1096,10 +1088,20 @@ function markoPlugin(opts = {}) {
1096
1088
  if (!isBuild) {
1097
1089
  const ext = path5.extname(id);
1098
1090
  if (ext === ".cjs" || ext === ".js" && isCJSModule(id)) {
1099
- try {
1100
- return await cjsToEsm(source);
1101
- } catch {
1102
- return null;
1091
+ if (cjsToEsm === void 0) {
1092
+ try {
1093
+ cjsToEsm = (await import("@chialab/cjs-to-esm")).transform;
1094
+ } catch {
1095
+ cjsToEsm = null;
1096
+ return null;
1097
+ }
1098
+ }
1099
+ if (cjsToEsm) {
1100
+ try {
1101
+ return await cjsToEsm(source);
1102
+ } catch {
1103
+ return null;
1104
+ }
1103
1105
  }
1104
1106
  }
1105
1107
  }
@@ -1190,7 +1192,6 @@ if (import.meta.hot) import.meta.hot.accept(() => {});`;
1190
1192
  }
1191
1193
  }
1192
1194
  }
1193
- serverManifest.optimizedRegistryIds = Object.fromEntries(optimizedRegistryIds);
1194
1195
  store.write(serverManifest);
1195
1196
  } else {
1196
1197
  const browserManifest = {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
3
  "description": "A Marko plugin for Vite",
4
- "version": "4.1.11",
4
+ "version": "4.1.13",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {