Skip to content

Commit 6d35cf7

Browse files
fix(node): use eval for require to avoid bundler issue (#3239)
1 parent bf31eb3 commit 6d35cf7

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.changeset/eighty-schools-smell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/node': patch
3+
---
4+
5+
use eval for require to avoid bundler warnings

.github/workflows/e2e-next-dev.yml

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
2828
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV
2929

30+
- name: Set local webpack
31+
run: echo "NEXT_PRIVATE_LOCAL_WEBPACK=true" >> $GITHUB_ENV
32+
3033
- name: Install Dependencies
3134
run: pnpm install
3235

packages/node/src/utils/hot-reload.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const getRequire = (): NodeRequire => {
1212
//@ts-ignore
1313
return typeof __non_webpack_require__ !== 'undefined'
1414
? __non_webpack_require__
15-
: require;
15+
: eval('require');
1616
};
1717

1818
function callsites(): any[] {

0 commit comments

Comments
 (0)