Skip to content

Commit

Permalink
fix(node): use eval for require to avoid bundler issue (#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy authored Nov 18, 2024
1 parent bf31eb3 commit 6d35cf7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eighty-schools-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/node': patch
---

use eval for require to avoid bundler warnings
3 changes: 3 additions & 0 deletions .github/workflows/e2e-next-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/utils/hot-reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getRequire = (): NodeRequire => {
//@ts-ignore
return typeof __non_webpack_require__ !== 'undefined'
? __non_webpack_require__
: require;
: eval('require');
};

function callsites(): any[] {
Expand Down

0 comments on commit 6d35cf7

Please sign in to comment.