Skip to content

Commit

Permalink
fix(modern-js-plugin): require node plugin on demand (#2835)
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 authored Aug 13, 2024
1 parent 4515ed6 commit 88dec4e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-clocks-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/modern-js': patch
---

fix(modern-js-plugin): require node plugin on demand
5 changes: 2 additions & 3 deletions packages/modernjs/src/cli/ssrPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import path from 'path';
import { fs } from '@modern-js/utils';
import type { CliPlugin, AppTools } from '@modern-js/app-tools';
import type { InternalModernPluginOptions } from '../types';
import { ModuleFederationPlugin } from '@module-federation/enhanced';
import { ModuleFederationPlugin } from '@module-federation/enhanced/webpack';
import { ModuleFederationPlugin as RspackModuleFederationPlugin } from '@module-federation/enhanced/rspack';
import { UniverseEntryChunkTrackerPlugin } from '@module-federation/node';
import UniverseEntryChunkTrackerPlugin from '@module-federation/node/universe-entry-chunk-tracker-plugin';
import { updateStatsAndManifest } from './manifest';
import { MODERN_JS_SERVER_DIR, PLUGIN_IDENTIFIER } from '../constant';
import { isDev } from './constant';

export function setEnv() {
Expand Down
4 changes: 4 additions & 0 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"./src/plugins/RemotePublicPathPlugin.js": "./dist/src/plugins/RemotePublicPathPlugin.js",
"./src/plugins/NodeFederationPlugin.js": "./dist/src/plugins/NodeFederationPlugin.js",
"./universe-entry-chunk-tracker-plugin": "./dist/src/plugins/UniverseEntryChunkTrackerPlugin.js",
"./src/": "./dist/src/"
},
"typesVersions": {
Expand All @@ -33,6 +34,9 @@
],
"record-dynamic-remote-entry-hash-plugin": [
"./dist/src/record-dynamic-remote-entry-hash-plugin.d.ts"
],
"universe-entry-chunk-tracker-plugin": [
"./dist/src/plugins/UniverseEntryChunkTrackerPlugin.d.ts"
]
}
},
Expand Down

0 comments on commit 88dec4e

Please sign in to comment.