@vercel/microfrontends 2.1.1 → 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 CHANGED
@@ -1,10 +1,16 @@
1
1
  # @vercel/microfrontends
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0606811: Fix local Next.js Image Optimization
8
+
3
9
  ## 2.1.1
4
10
 
5
11
  ### Patch Changes
6
12
 
7
- - 96f0ea5:
13
+ - 96f0ea5:
8
14
  - Add support for locally overriding to MFE aliases: https://vercel.com/changelog/preview-links-between-microfrontends-projects-now-serve-all-paths
9
15
  - Fix local Next.js image optimization. Next.js released a security fix which removes headers from being passed on image optimization requests. The microfrontends local proxy previously relied on the headers being passed.
10
16
 
package/dist/bin/cli.cjs CHANGED
@@ -30,7 +30,7 @@ var import_env = require("@next/env");
30
30
  // package.json
31
31
  var package_default = {
32
32
  name: "@vercel/microfrontends",
33
- version: "2.1.1",
33
+ version: "2.1.2",
34
34
  private: false,
35
35
  description: "Defines configuration and utilities for microfrontends development",
36
36
  keywords: [
@@ -1694,22 +1694,18 @@ function routeToLocalProxy() {
1694
1694
 
1695
1695
  // src/next/config/transforms/redirects.ts
1696
1696
  function transform4(args) {
1697
- const { next, microfrontend, opts } = args;
1697
+ const { next, microfrontend, opts, app } = args;
1698
1698
  const isProduction2 = opts?.isProduction ?? false;
1699
1699
  const requireLocalProxyHeader = routeToLocalProxy() && !isProduction2 && !process.env.MFE_DISABLE_LOCAL_PROXY_REWRITE;
1700
1700
  if (requireLocalProxyHeader) {
1701
+ const assetPrefix = app.getAssetPrefix();
1701
1702
  const proxyRedirects = [
1702
1703
  {
1703
- source: "/:path*",
1704
+ source: `/((?!${assetPrefix ? `${assetPrefix}/` : ""}_next/static).*)`,
1704
1705
  destination: `http://localhost:${microfrontend.getLocalProxyPort()}/:path*`,
1705
1706
  permanent: false,
1706
1707
  missing: [
1707
- { type: "header", key: "x-vercel-mfe-local-proxy-origin" },
1708
- {
1709
- type: "host",
1710
- value: `localhost:${microfrontend.getLocalProxyPort()}`
1711
- // if it's already on the host, we don't need to redirect
1712
- }
1708
+ { type: "header", key: "x-vercel-mfe-local-proxy-origin" }
1713
1709
  ]
1714
1710
  }
1715
1711
  ];