Skip to content

Commit 67adcf1

Browse files
fix(dts-plugin): build zip url for json
1 parent 3c57a61 commit 67adcf1

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.changeset/chatty-lies-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/dts-plugin': patch
3+
---
4+
5+
Build zip url for json ext as well

apps/node-local-remote/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = composePlugins(withNx(), (config) => {
1515
new UniversalFederationPlugin({
1616
isServer: true,
1717
name: 'node-local-remote',
18-
library: { type: 'commonjs-module' },
18+
library: { type: 'commonjs-module', name: 'node-local-remote' },
1919
filename: 'remoteEntry.js',
2020
exposes: {
2121
'./test': './src/expose.js',

packages/dts-plugin/src/core/configurations/hostPlugin.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ const defaultOptions = {
1717
const buildZipUrl = (hostOptions: Required<HostOptions>, url: string) => {
1818
const remoteUrl = new URL(url);
1919

20-
if (remoteUrl.href.includes(MANIFEST_EXT)) {
21-
return undefined;
22-
}
2320
const pathnameWithoutEntry = remoteUrl.pathname
2421
.split('/')
2522
.slice(0, -1)
@@ -51,6 +48,7 @@ const retrieveRemoteInfo = (options: {
5148
: parsedInfo.name === remote
5249
? remote
5350
: '';
51+
5452
const zipUrl = url ? buildZipUrl(hostOptions, url) : '';
5553

5654
return {

packages/managers/src/ContainerManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ContainerManager extends BasicPluginOptionsManager<moduleFederationPlugin.
4141
if (typeof library.name === 'string') {
4242
return library.name;
4343
}
44-
return name;
44+
return undefined;
4545
}
4646

4747
return name;

packages/manifest/src/ManifestManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ class ManifestManager {
126126

127127
if (isDev()) {
128128
console.log(
129-
chalk`{bold {greenBright [ ${PLUGIN_IDENTIFIER} ]} {greenBright Manifest Link:} {cyan ${publicPath}${manifestFileName}}}`,
129+
chalk`{bold {greenBright [ ${PLUGIN_IDENTIFIER} ]} {greenBright Manifest Link:} {cyan ${
130+
publicPath === 'auto' ? '{auto}/' : publicPath
131+
}${manifestFileName}}}`,
130132
);
131133
}
132134
}

0 commit comments

Comments
 (0)