angular-cn/packages/compiler-cli
George Kalpakas cfbb1a1e77 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
..
integrationtest Revert "refactor: handle breaking changes in rules_nodejs 1.0.0 (#34589)" (#34730) 2020-01-10 14:12:15 -08:00
ngcc fix(ngcc): correctly detect dependencies in CommonJS (#34528) 2020-01-13 09:48:20 -08:00
src fix(ivy): don't run decorator handlers against declaration files (#34557) 2020-01-10 15:54:51 -08:00
test Revert "refactor: handle breaking changes in rules_nodejs 1.0.0 (#34589)" (#34730) 2020-01-10 14:12:15 -08:00
BUILD.bazel Revert "build: upgrade to rules_nodejs 1.0.0 (first stable release) (#34589)" (#34730) 2020-01-10 14:12:15 -08:00
index.ts refactor(compiler-cli): Move diagnostics files to language service (#33809) 2019-11-14 09:29:07 -08:00
package.json build: set up all packages to publish via wombot proxy (#33747) 2019-11-13 11:34:33 -08:00
tsconfig-build.json build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
tsconfig.json perf(ivy): ngcc - only find dependencies when targeting a single entry-point (#30525) 2019-07-09 09:40:46 -07:00