@vercel/microfrontends 1.4.0-canary.0 → 1.4.0-canary.1

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,5 +1,11 @@
1
1
  # @vercel/microfrontends
2
2
 
3
+ ## 1.4.0-canary.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update the logic for which require function to use to be compatible with tsup/esbuild.
8
+
3
9
  ## 1.4.0-canary.0
4
10
 
5
11
  ### Minor Changes
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: "1.4.0-canary.0",
33
+ version: "1.4.0-canary.1",
34
34
  private: false,
35
35
  description: "Defines configuration and utilities for microfrontends development",
36
36
  keywords: [
@@ -1704,7 +1704,6 @@ var SortChunksPlugin = class {
1704
1704
 
1705
1705
  // src/next/config/transforms/webpack.ts
1706
1706
  var import_meta = {};
1707
- var cjsRequire = typeof require === "function" ? require : (0, import_node_module.createRequire)(import_meta.url);
1708
1707
  var nextVersion = getNextJsVersion();
1709
1708
  function transform6(args) {
1710
1709
  const useDefineServer = args.opts?.preferWebpackEnvironmentPlugin ? false : semver.gte(nextVersion, "15.4.0-canary.41");
@@ -1763,8 +1762,15 @@ function transform6(args) {
1763
1762
  };
1764
1763
  }
1765
1764
  function getNextJsVersion() {
1765
+ const cjsRequire = (
1766
+ // This is used so we can use `require.resolve` to find the Next.js package:
1767
+ // - `import.meta.resolve` is not available in CJS or early Node.js versions.
1768
+ // - tsup/esbuild don't generate import meta urls for CJS modules, so use this as
1769
+ // a test to see if we're running in ESM. Referencing `import.meta.url` is
1770
+ // still grammatically valid in CJS because esbuild transforms it.
1771
+ typeof import_meta.url === "string" ? (0, import_node_module.createRequire)(import_meta.url) : require
1772
+ );
1766
1773
  const parsedNextPackageJson = JSON.parse(
1767
- // `import.meta.url` is not available in CJS or early Node.js versions
1768
1774
  import_node_fs8.default.readFileSync(cjsRequire.resolve("next/package.json"), "utf8")
1769
1775
  );
1770
1776
  if (typeof parsedNextPackageJson !== "object" || parsedNextPackageJson === null) {