File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 2
2
* @module module:@ui5/project
3
3
* @public
4
4
*/
5
- module . exports = {
6
- normalizer : require ( "./lib/normalizer" ) ,
7
- projectPreprocessor : require ( "./lib/projectPreprocessor" ) ,
5
+ const modules = {
6
+ normalizer : "./lib/normalizer" ,
7
+ projectPreprocessor : "./lib/projectPreprocessor" ,
8
8
/**
9
9
* @public
10
10
* @see module:@ui5/project.ui5Framework
@@ -29,7 +29,26 @@ module.exports = {
29
29
* @namespace
30
30
*/
31
31
translators : {
32
- "npm" : require ( "./lib/translators/npm" ) ,
33
- "static" : require ( "./lib/translators/static" )
32
+ "npm" : "./lib/translators/npm" ,
33
+ "static" : "./lib/translators/static"
34
34
}
35
35
} ;
36
+
37
+ function exportModules ( exportRoot , modulePaths ) {
38
+ for ( const moduleName in modulePaths ) {
39
+ if ( modulePaths . hasOwnProperty ( moduleName ) ) {
40
+ if ( typeof modulePaths [ moduleName ] === "object" ) {
41
+ exportRoot [ moduleName ] = { } ;
42
+ exportModules ( exportRoot [ moduleName ] , modulePaths [ moduleName ] ) ;
43
+ } else {
44
+ Object . defineProperty ( exportRoot , moduleName , {
45
+ get ( ) {
46
+ return require ( modulePaths [ moduleName ] ) ;
47
+ }
48
+ } ) ;
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ exportModules ( module . exports , modules ) ;
You can’t perform that action at this time.
0 commit comments