Skip to content

Commit 7ff42cf

Browse files
committed
refactor(npm-tools): rename method
1 parent c80eddf commit 7ff42cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/npm-tools/packages/npm-scripts/src/utils/createFederationConfig.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ module.exports = async function () {
225225
plugins: [
226226
new ModuleFederationPlugin({
227227
exposes: {
228-
...prefixExposesPaths(exposes, `./${build.input}/`),
228+
...transformExposes(exposes, build.input),
229229
'.': mainFilePath,
230230
},
231231
filename: 'container.js',
@@ -263,13 +263,13 @@ module.exports = async function () {
263263
};
264264
};
265265

266-
function prefixExposesPaths(exposes, prefix) {
266+
function transformExposes(exposes, inputDirectory) {
267267
return exposes.reduce((exposes, filePath) => {
268268
const exposeName = path.posix
269269
.relative('.', filePath)
270270
.replace(/\.js$/i, '');
271271

272-
exposes[exposeName] = `${prefix}${filePath}`;
272+
exposes[exposeName] = `./${inputDirectory}/${filePath}`;
273273

274274
return exposes;
275275
}, {});

0 commit comments

Comments
 (0)