File tree Expand file tree Collapse file tree 1 file changed +15
-18
lines changed Expand file tree Collapse file tree 1 file changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,21 @@ namespace Moduless
92
92
const ex = require ( project . outFile ) ;
93
93
if ( ex && typeof ex === "object" && ! Array . isArray ( ex ) )
94
94
out . push ( { project, exported : ex } ) ;
95
+
96
+ // Globalize the exports of the project.
97
+ for ( const [ name , value ] of Object . entries ( ex ) )
98
+ {
99
+ if ( name in globalThis )
100
+ {
101
+ console . warn (
102
+ `Skipping adding ${ name } from ${ project . projectPath } to global scope ` +
103
+ `because another member with this name is already defined globally.` ) ;
104
+
105
+ continue ;
106
+ }
107
+
108
+ ( globalThis as any ) [ name ] = value ;
109
+ }
95
110
}
96
111
catch ( e )
97
112
{
@@ -115,24 +130,6 @@ namespace Moduless
115
130
if ( ! startingProject )
116
131
throw new Error ( "No projects found at location: " + target . projectPath ) ;
117
132
118
- // Globalize the exports of all projects.
119
- for ( const { project, exported } of graph )
120
- {
121
- for ( const [ name , value ] of Object . entries ( exported ) )
122
- {
123
- if ( name in globalThis )
124
- {
125
- console . warn (
126
- `Skipping adding ${ name } from ${ project . projectPath } to global scope ` +
127
- `because another member with this name is already defined globally.` ) ;
128
-
129
- continue ;
130
- }
131
-
132
- ( globalThis as any ) [ name ] = value ;
133
- }
134
- }
135
-
136
133
const tryResolveNamepace = ( root : object ) =>
137
134
{
138
135
let current : any = root ;
You can’t perform that action at this time.
0 commit comments