Skip to content

Commit

Permalink
feat(eval-addons): empty module should not be exposed to global
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 30, 2020
1 parent 008ae38 commit 3354b83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/plugin-eval-addons/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ async function createModule(path: string) {
await module.evaluate()

if (!path.includes('/')) {
internal.setGlobal(path, internal.decontextify(module.namespace))
const namespace = internal.decontextify(module.namespace)
if (Object.keys(namespace).length) {
internal.setGlobal(path, namespace)
}
}
return module
}
Expand Down

0 comments on commit 3354b83

Please sign in to comment.