fix(build): serve stable aliases for lazy plugin runtimes
This commit is contained in:
1 parent
ab0a4ff27d
commit
f4eaf416be
4 files changed
+13
-2
No files matched your search
@@ -1053,6 +1053,13 @@ async function emitPluginAssets(
|
||||
immutable: true,
|
||||
});
|
||||
// The emitted runtime is served from its content-addressed public path.
|
||||
// Lazy runtime imports use stable plugin URLs, just as in development.
|
||||
// Keep that alias revalidatable while the HTML uses the immutable URL.
|
||||
const stablePath = runtime.publicPath ?? `/__wrnexus/assets/${safeAssetName(runtime.id)}.js`;
|
||||
if (stablePath !== publicPath) {
|
||||
assets.push({ id: runtime.id, publicPath: stablePath, file,
|
||||
contentType: "text/javascript; charset=utf-8", runtime: true, immutable: false });
|
||||
}
|
||||
// Keep an empty source marker so @wrnexus/plugin can normalize this
|
||||
// already-emitted descriptor during production HTML rendering without
|
||||
// trying to resolve the original build-time source on the deploy host.
|
||||
|
||||
Reference in new issue
Block a user