Skip to content

Commit

Permalink
wip(jack)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored and Jack Hsu committed Apr 4, 2022
1 parent b7e10a5 commit 48e54eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion e2e/react/src/react.mfe.test.ts
Expand Up @@ -34,7 +34,7 @@ describe('React MFE', () => {
});

updateFile(
`apps/${shell}/mfe.config.js`,
`apps/${shell}/webpack.config.js`,
stripIndents`
const withModuleFederation = require('@nrwl/react/module-federation');
const mfeConfig = require('./mfe.config');
Expand Down
Expand Up @@ -23,7 +23,7 @@ export default async function* mfeDevServer(
} catch {
// TODO(jack): Add a link to guide
throw new Error(
`Could not load ${mfeConfig}. Was this project generated with "@nrwl/react:mfe-host"?`
`Could not load ${mfeConfigPath}. Was this project generated with "@nrwl/react:mfe-host"?`
);
}

Expand Down
6 changes: 4 additions & 2 deletions packages/react/src/mfe/with-module-federation.ts
Expand Up @@ -171,9 +171,11 @@ function mapRemotes(remotes: MFERemotes) {
if (!remoteLocation.includes('@')) {
remoteLocation = `${remoteName}@${remoteLocation}`;
}
if (!remoteLocation.match(/remoteEntry\.(js|mjs)/)) {
if (!remoteLocation.match(/remoteEntry\.(js|mjs)$/)) {
remoteLocation = `${
remoteLocation.endsWith('/') ? remote[1].slice(0, -1) : remote[1]
remoteLocation.endsWith('/')
? remoteLocation.slice(0, -1)
: remoteLocation
}/remoteEntry.js`;
}
mappedRemotes[remoteName] = remoteLocation;
Expand Down

0 comments on commit 48e54eb

Please sign in to comment.