Skip to content

Commit

Permalink
handle null modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cfryerdev committed May 15, 2024
1 parent 2c6e500 commit 1cfe394
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/dmf-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dream.mf/core",
"version": "1.2.0",
"version": "1.2.1",
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
Expand Down
8 changes: 6 additions & 2 deletions packages/dmf-core/src/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ export const registerRuntimeRemote = (
(item) => item.scope === scope,
);
if (!scopeExists) {
var record = { scope, modules: [module], url } as Remotes;
var record = {
scope,
modules: module == null ? [] : [module],
url,
} as Remotes;
window[RuntimeName].remotes.push(record);
} else {
const s = window[RuntimeName].remotes.find((sc) => sc.scope === scope);
if (!s.modules.includes(module)) {
if (module !== null && !s.modules.includes(module)) {
s.modules.push(module);
}
}
Expand Down

0 comments on commit 1cfe394

Please sign in to comment.