@vercel/microfrontends 2.1.0 → 2.1.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.
- package/CHANGELOG.md +14 -0
- package/dist/bin/cli.cjs +63 -10
- package/dist/next/config.cjs +6 -3
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.js +6 -3
- package/dist/next/config.js.map +1 -1
- package/package.json +1 -1
package/dist/next/config.js
CHANGED
|
@@ -1666,16 +1666,19 @@ function routeToLocalProxy() {
|
|
|
1666
1666
|
|
|
1667
1667
|
// src/next/config/transforms/redirects.ts
|
|
1668
1668
|
function transform4(args) {
|
|
1669
|
-
const { next, microfrontend, opts } = args;
|
|
1669
|
+
const { next, microfrontend, opts, app } = args;
|
|
1670
1670
|
const isProduction2 = opts?.isProduction ?? false;
|
|
1671
1671
|
const requireLocalProxyHeader = routeToLocalProxy() && !isProduction2 && !process.env.MFE_DISABLE_LOCAL_PROXY_REWRITE;
|
|
1672
1672
|
if (requireLocalProxyHeader) {
|
|
1673
|
+
const assetPrefix = app.getAssetPrefix();
|
|
1673
1674
|
const proxyRedirects = [
|
|
1674
1675
|
{
|
|
1675
|
-
source: "
|
|
1676
|
+
source: `/((?!${assetPrefix ? `${assetPrefix}/` : ""}_next/static).*)`,
|
|
1676
1677
|
destination: `http://localhost:${microfrontend.getLocalProxyPort()}/:path*`,
|
|
1677
1678
|
permanent: false,
|
|
1678
|
-
missing: [
|
|
1679
|
+
missing: [
|
|
1680
|
+
{ type: "header", key: "x-vercel-mfe-local-proxy-origin" }
|
|
1681
|
+
]
|
|
1679
1682
|
}
|
|
1680
1683
|
];
|
|
1681
1684
|
if (next.redirects && typeof next.redirects === "function") {
|