fix(ngcc): handle CommonJS re-exports by reference (#34254)
In TS we can re-export imports using statements of the form: ``` export * from 'some-import'; ``` This can be downleveled in CommonJS to either: ``` __export(require('some-import')); ``` or ``` var someImport = require('some-import'); __export(someImport); ``` Previously we only supported the first downleveled version. This commit adds support for the second version. PR Close #34254
This commit is contained in:

committed by
Kara Erickson

parent
b2a8466e45
commit
9ca5faab47
@ -557,7 +557,8 @@ exports.xtra2 = xtra2;
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
__export(require("./b_module"));
|
||||
var b_module = require("./b_module");
|
||||
__export(b_module);
|
||||
__export(require("./xtra_module"));
|
||||
`
|
||||
},
|
||||
|
Reference in New Issue
Block a user