@marko/vite 5.0.1 → 5.0.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.
Files changed (2) hide show
  1. package/dist/index.mjs +21 -1
  2. package/package.json +3 -1
package/dist/index.mjs CHANGED
@@ -804,6 +804,8 @@ var babelCaller = {
804
804
  };
805
805
  var registeredTagLib = false;
806
806
  var cjsToEsm;
807
+ function noop2() {
808
+ }
807
809
  function markoPlugin(opts = {}) {
808
810
  let { linked = true } = opts;
809
811
  let runtimeId;
@@ -1096,6 +1098,12 @@ function markoPlugin(opts = {}) {
1096
1098
  entryIds.add(id);
1097
1099
  cachedSources.set(id, serverManifest.entrySources[entry]);
1098
1100
  }
1101
+ for (const assetId of serverManifest.ssrAssetIds) {
1102
+ this.load({
1103
+ id: normalizePath(path6.resolve(root, assetId)),
1104
+ resolveDependencies: false
1105
+ }).catch(noop2);
1106
+ }
1099
1107
  } catch (err) {
1100
1108
  this.error(
1101
1109
  `You must run the "ssr" build before the "browser" build.`
@@ -1193,7 +1201,8 @@ function markoPlugin(opts = {}) {
1193
1201
  serverManifest ??= {
1194
1202
  entries: {},
1195
1203
  entrySources: {},
1196
- chunksNeedingAssets: []
1204
+ chunksNeedingAssets: [],
1205
+ ssrAssetIds: []
1197
1206
  };
1198
1207
  serverManifest.entries[entryId] = relativeFileName;
1199
1208
  serverManifest.entrySources[relativeFileName] = source;
@@ -1337,6 +1346,17 @@ if (import.meta.hot) import.meta.hot.accept(() => {});`;
1337
1346
  }
1338
1347
  }
1339
1348
  }
1349
+ serverManifest.ssrAssetIds = [];
1350
+ for (const moduleId of this.getModuleIds()) {
1351
+ if (moduleId.startsWith(root)) {
1352
+ const module = this.getModuleInfo(moduleId);
1353
+ if (module?.meta["vite:asset"]) {
1354
+ serverManifest.ssrAssetIds.push(
1355
+ "." + moduleId.slice(root.length)
1356
+ );
1357
+ }
1358
+ }
1359
+ }
1340
1360
  store.write(serverManifest);
1341
1361
  } else {
1342
1362
  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.1",
4
+ "version": "5.0.2",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {
@@ -21,6 +21,7 @@
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
+ "@types/diff": "^6.0.0",
24
25
  "@types/jsdom": "^21.1.7",
25
26
  "@types/mocha": "^10.0.9",
26
27
  "@types/node": "^22.9.0",
@@ -29,6 +30,7 @@
29
30
  "@typescript-eslint/eslint-plugin": "^7.11.0",
30
31
  "@typescript-eslint/parser": "^7.11.0",
31
32
  "cross-env": "^7.0.3",
33
+ "diff": "^7.0.0",
32
34
  "esbuild": "^0.24.0",
33
35
  "eslint": "^8.57.0",
34
36
  "eslint-config-prettier": "^9.1.0",