angular/packages/compiler-cli/ngcc/src
George Kalpakas ff02ddfd9b fix(ngcc): correctly detect dependencies in CommonJS (#34528)
Previously, `CommonJsDependencyHost.collectDependencies()` would only
find dependencies via imports of the form `var foo = require('...');` or
`var foo = require('...'), bar = require('...');` However, CommonJS
files can have imports in many different forms. By failing to recognize
other forms of imports, the associated dependencies were missed, which
in turn resulted in entry-points being compiled out-of-order and failing
due to that.

While we cannot easily capture all different types of imports, this
commit enhances `CommonJsDependencyHost` to recognize the following
common forms of imports:

- Imports in property assignments. E.g.:
  `exports.foo = require('...');` or
  `module.exports = {foo: require('...')};`

- Imports for side-effects only. E.g.:
  `require('...');`

- Star re-exports (with both emitted and imported heleprs). E.g.:
  `__export(require('...'));` or
  `tslib_1.__exportStar(require('...'), exports);`

PR Close #34528
2020-01-13 09:48:20 -08:00
..
analysis fix(ivy): don't run decorator handlers against declaration files (#34557) 2020-01-10 15:54:52 -08:00
dependencies fix(ngcc): correctly detect dependencies in CommonJS (#34528) 2020-01-13 09:48:20 -08:00
entry_point_finder fix(ngcc): do not analyze dependencies for non Angular entry-points (#32303) 2019-08-26 10:08:44 -07:00
execution refactor(ngcc): add debug messages to help with debugging in parallel mode (#34437) 2019-12-17 11:39:19 -08:00
host fix(ngcc): recognize re-exports with imported TS helpers in CommonJS and UMD (#34527) 2020-01-10 08:28:50 -08:00
logging feat(compiler-cli): ngcc - make logging more configurable (#29591) 2019-04-01 11:53:28 -07:00
migrations fix(ngcc): fix undecorated child migration when exportAs is present (#34014) 2019-12-09 16:13:10 -08:00
packages refactor(ngcc): use bundle src to create reflection hosts (#34254) 2019-12-18 11:25:02 -08:00
rendering fix(ngcc): insert definitions after statement (#34677) 2020-01-08 15:09:25 -08:00
writing refactor(ngcc): abstract updating package.json files behind an interface (#32427) 2019-09-09 15:55:13 -04:00
constants.ts refactor(ivy): move ngcc into a higher level folder (#29092) 2019-03-20 14:45:54 -04:00
main.ts fix(ngcc): avoid error due to circular dependency in EsmDependencyHost (#34512) 2020-01-08 15:00:51 -08:00
utils.ts fix(ngcc): avoid error due to circular dependency in EsmDependencyHost (#34512) 2020-01-08 15:00:51 -08:00