mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Previously with ESBuild 0.14.11, when a file had dynamic requires to
builtin NodeJS modules like `url`, the resolution completed successfully
regardless of `--platform browser`. This seems to be fixed in ESBuild now.
This unveiled some resolution errors with our Saucelabs bundle generation
because the framework code sometimes switches dynamically to `require('url')`
if `window.URL` is not defined. Previously this just didn't matter, but now
the `require('url')` is checked and a module resolution error is reported given
`url` not being available in the browser as a builtin module.
We fix this by marking the module as external. We will not hit this code path
anyway in the browser saucelabs code. Similarly we exclude all platform-server
files from the bundle. This is not strictly needed after the `url` module being
marked as external, but the issue showed that lots of unnecessary code for the
server platform is included. This can be omitted (unfortunately not from the TS
compilation without over-complicating things significantly more; experimented with
that).
PR Close #44830
|
||
|---|---|---|
| .. | ||
| build | ||
| circular_dependency_test | ||
| contributing-stats | ||
| gulp-tasks | ||
| legacy-saucelabs | ||
| npm | ||
| rxjs | ||
| saucelabs | ||
| size-tracking | ||
| source-map-test | ||
| symbol-extractor | ||
| testing | ||
| tslint | ||
| BUILD.bazel | ||
| defaults.bzl | ||
| extract_typings_rule.bzl | ||
| inline-package-json-deps.js | ||
| jasmine-seed-generator.js | ||
| jsconfig.json | ||
| ng_benchmark.bzl | ||
| postinstall-patches.js | ||
| tsconfig-test.json | ||
| tsconfig.json | ||
| types.d.ts | ||
| utils.inc | ||