@marko/vite 5.0.3 → 5.0.5

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 +20 -3
  2. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -844,6 +844,7 @@ function markoPlugin(opts = {}) {
844
844
  );
845
845
  const entryIds = /* @__PURE__ */ new Set();
846
846
  const cachedSources = /* @__PURE__ */ new Map();
847
+ const optimizedRegisistyIdMap = /* @__PURE__ */ new Map();
847
848
  const transformWatchFiles = /* @__PURE__ */ new Map();
848
849
  const transformOptionalFiles = /* @__PURE__ */ new Map();
849
850
  const store = new ReadOncePersistedStore(
@@ -866,14 +867,23 @@ function markoPlugin(opts = {}) {
866
867
  if ("BASE_URL" in process.env && config.base == null) {
867
868
  config.base = process.env.BASE_URL;
868
869
  }
870
+ root = normalizePath(config.root || process.cwd());
869
871
  baseConfig = {
870
872
  cache,
871
873
  optimize,
872
- // optimizedRegistryIds:
873
- // optimize && linked ? optimizedRegistryIds : undefined,
874
874
  runtimeId,
875
875
  sourceMaps: true,
876
876
  writeVersionComment: false,
877
+ optimizeRegistryId(id) {
878
+ let registryId = optimizedRegisistyIdMap.get(id);
879
+ if (registryId === void 0) {
880
+ optimizedRegisistyIdMap.set(
881
+ id,
882
+ registryId = optimizedRegisistyIdMap.size
883
+ );
884
+ }
885
+ return registryId;
886
+ },
877
887
  babelConfig: opts.babelConfig ? {
878
888
  ...opts.babelConfig,
879
889
  caller: opts.babelConfig.caller ? {
@@ -910,7 +920,6 @@ function markoPlugin(opts = {}) {
910
920
  output: "hydrate"
911
921
  };
912
922
  compiler2.configure(baseConfig);
913
- root = normalizePath(config.root || process.cwd());
914
923
  devEntryFile = path6.join(root, "index.html");
915
924
  devEntryFilePosix = normalizePath(devEntryFile);
916
925
  isTest = env.mode === "test";
@@ -1093,6 +1102,11 @@ function markoPlugin(opts = {}) {
1093
1102
  try {
1094
1103
  serverManifest = await store.read();
1095
1104
  inputOptions.input = toHTMLEntries(root, serverManifest.entries);
1105
+ if (serverManifest.registered) {
1106
+ for (let i = 0; i < serverManifest.registered.length; i++) {
1107
+ optimizedRegisistyIdMap.set(serverManifest.registered[i], i);
1108
+ }
1109
+ }
1096
1110
  for (const entry in serverManifest.entrySources) {
1097
1111
  const id = normalizePath(path6.resolve(root, entry));
1098
1112
  entryIds.add(id);
@@ -1357,6 +1371,9 @@ if (import.meta.hot) import.meta.hot.accept(() => {});`;
1357
1371
  }
1358
1372
  }
1359
1373
  }
1374
+ if (optimizedRegisistyIdMap.size) {
1375
+ serverManifest.registered = [...optimizedRegisistyIdMap.keys()];
1376
+ }
1360
1377
  store.write(serverManifest);
1361
1378
  } else {
1362
1379
  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": "5.0.3",
4
+ "version": "5.0.5",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {
@@ -16,15 +16,15 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "@changesets/changelog-github": "^0.5.0",
19
- "@changesets/cli": "^2.27.9",
20
- "@marko/compiler": "^5.37.26",
19
+ "@changesets/cli": "^2.27.10",
20
+ "@marko/compiler": "^5.38.0",
21
21
  "@marko/fixture-snapshots": "^2.2.1",
22
22
  "@marko/testing-library": "^6.2.0",
23
23
  "@types/babel__core": "^7.20.5",
24
24
  "@types/diff": "^6.0.0",
25
25
  "@types/jsdom": "^21.1.7",
26
- "@types/mocha": "^10.0.9",
27
- "@types/node": "^22.9.0",
26
+ "@types/mocha": "^10.0.10",
27
+ "@types/node": "^22.9.1",
28
28
  "@types/resolve": "^1.20.6",
29
29
  "@types/serve-handler": "^6.1.4",
30
30
  "@typescript-eslint/eslint-plugin": "^7.11.0",
@@ -39,7 +39,7 @@
39
39
  "jsdom": "^25.0.1",
40
40
  "less": "^4.2.0",
41
41
  "lint-staged": "^15.2.10",
42
- "marko": "^5.35.35",
42
+ "marko": "^5.36.0",
43
43
  "mocha": "^10.8.2",
44
44
  "mocha-snap": "^5.0.0",
45
45
  "nyc": "^17.1.0",
@@ -47,7 +47,7 @@
47
47
  "prettier": "^3.3.3",
48
48
  "serve-handler": "^6.1.6",
49
49
  "tsx": "^4.19.2",
50
- "typescript": "^5.6.3",
50
+ "typescript": "^5.7.2",
51
51
  "vite": "^5.4.11"
52
52
  },
53
53
  "files": [