diff --git a/.changeset/eighty-schools-smell.md b/.changeset/eighty-schools-smell.md new file mode 100644 index 00000000000..15515cd660f --- /dev/null +++ b/.changeset/eighty-schools-smell.md @@ -0,0 +1,5 @@ +--- +'@module-federation/node': patch +--- + +use eval for require to avoid bundler warnings diff --git a/.github/workflows/e2e-next-dev.yml b/.github/workflows/e2e-next-dev.yml index b49564b4011..661422bac93 100644 --- a/.github/workflows/e2e-next-dev.yml +++ b/.github/workflows/e2e-next-dev.yml @@ -27,6 +27,9 @@ jobs: - name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV + - name: Set local webpack + run: echo "NEXT_PRIVATE_LOCAL_WEBPACK=true" >> $GITHUB_ENV + - name: Install Dependencies run: pnpm install diff --git a/packages/node/src/utils/hot-reload.ts b/packages/node/src/utils/hot-reload.ts index 8dac5810fc6..f350a6a3e4c 100644 --- a/packages/node/src/utils/hot-reload.ts +++ b/packages/node/src/utils/hot-reload.ts @@ -12,7 +12,7 @@ const getRequire = (): NodeRequire => { //@ts-ignore return typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ - : require; + : eval('require'); }; function callsites(): any[] {