@marko/vite 4.1.8 → 4.1.9

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 +8 -7
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -833,6 +833,10 @@ function markoPlugin(opts = {}) {
833
833
  "Cannot use @marko/vite `basePathVar` with Vite's `renderBuiltUrl` option."
834
834
  );
835
835
  }
836
+ if (isSSRBuild && !config.build?.ssrEmitAssets) {
837
+ config.build ??= {};
838
+ config.build.assetsDir ??= "";
839
+ }
836
840
  const assetsDir = config.build?.assetsDir?.replace(/[/\\]$/, "") ?? "assets";
837
841
  const assetsDirLen = assetsDir.length;
838
842
  const assetsDirEnd = assetsDirLen + 1;
@@ -1168,13 +1172,10 @@ if (import.meta.hot) import.meta.hot.accept(() => {});`;
1168
1172
  for (const fileName in bundle) {
1169
1173
  const chunk = bundle[fileName];
1170
1174
  if (chunk.type === "chunk") {
1171
- for (const id in chunk.modules) {
1172
- if (id.endsWith(serverEntryQuery)) {
1173
- serverManifest.chunksNeedingAssets.push(
1174
- path5.resolve(dir, fileName)
1175
- );
1176
- break;
1177
- }
1175
+ if (chunk.moduleIds.includes(renderAssetsRuntimeId)) {
1176
+ serverManifest.chunksNeedingAssets.push(
1177
+ path5.resolve(dir, fileName)
1178
+ );
1178
1179
  }
1179
1180
  }
1180
1181
  }
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.8",
4
+ "version": "4.1.9",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {