angular-cn/tools
Terence D. Honles 078b0be4dc fix(common): `locales/global/*.js` are not ES5 compliant (#36342)
Although this code has been part of Angular 9.x I only noticed this
error when upgrading to Angular 9.1.x because historically the source
locale data was not injected when localizing, but as of
angular/angular-cli#16394 (9.1.0) it is now included. This tipped me off
that my other bundles were not being built properly, and this change
allows me to build a valid ES5 bundle (I have also added a verification
step to my build pipeline to alert me if this error appears again in any
of my bundles).

I found the `locales/global/*.js` file paths being referenced by the
`I18nOptions` in
@angular-devkit/build-angular/src/utils/i18n-options.ts,
and following that it looks like it is actually loaded and used in
@angular-devkit/build-angular/src/utils/process-bundle.ts. I saw the
function `terserMangle` does appear that it is likely aware of the build
being ES5, but I'm not sure why this is not producing a valid ES5
bundle.

This change updates `tools/gulp-tasks/cldr/extract.js` to produce ES5
compliant `locales/global/*.js` and that fixes my issue. However, I am
not sure if @angular-devkit/build-angular should be modified to produce
a valid ES5 bundle instead or if the files could be TypeScript rather
than JavaScript files.

A test that a valid ES5 bundle is produced would be helpful, and I hope
this is reproducible and not some issue with my config.

PR Close #36342
2020-04-09 11:30:32 -07:00
..
brotli-cli build: switch to @build_bazel_rules_nodejs//:index.bzl load point (#33433) 2019-10-28 10:10:48 -07:00
browsers build: fixes for cross-platform RBE (#33708) 2019-11-15 10:49:55 -08:00
build build: remove obsolete build related tools and helper scripts (#34058) 2019-12-02 10:52:21 -08:00
circular_dependency_test build: don't use deprecated $(location) pre-declared variable (#36308) 2020-03-31 11:02:56 -07:00
components feat(benchpress): create component_benchmark macro (#35692) 2020-03-20 10:19:25 -07:00
contributing-stats fix(dev-infra): sort contributors alphabetically in `get-data.ts` script (#35997) 2020-03-11 14:49:18 -04:00
gulp-tasks fix(common): `locales/global/*.js` are not ES5 compliant (#36342) 2020-04-09 11:30:32 -07:00
ng_rollup_bundle build: ng_rollup_bundle internal rule should support ngcc (#36044) 2020-03-18 15:57:07 -07:00
ngcontainer build: depend on bazelisk rather than directly on Bazel (#36078) 2020-03-16 10:58:06 -07:00
npm build(bazel): remove hacky fake @angular/bazel npm package under tools/npm/@angular_bazel (#36009) 2020-03-11 14:43:13 -04:00
npm_integration_test build: don't use deprecated $(location) pre-declared variable (#36308) 2020-03-31 11:02:56 -07:00
rxjs build: update to rules_nodejs 0.32.2 (#31325) 2019-07-01 14:16:42 -07:00
saucelabs build(bazel): fix runfiles resolve in karma-saucelabs.js after $location => $rootpath cleanup (#36511) 2020-04-08 12:13:27 -07:00
size-tracking build: update scripting and tooling to rely on define=angular_ivy_enabled instream of define=compile (#33983) 2019-11-26 16:38:40 -05:00
source-map-test build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
symbol-extractor build: don't use deprecated $(location) pre-declared variable (#36308) 2020-03-31 11:02:56 -07:00
testing build: update to rules_nodejs 1.1.0 (#34736) 2020-01-15 14:58:07 -05:00
ts-api-guardian style: typescript lint fix (#36531) 2020-04-09 00:59:21 +00:00
tslint build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
utils build: ensure that refs and shas for PRs only need to be requested once (#36207) 2020-03-25 11:49:42 -07:00
yarn build: upgrade yarn to 1.3.2 (#21406) 2018-01-10 12:32:26 -08:00
BUILD.bazel build: remove rollup packaging from dev-infra (#35647) 2020-03-17 12:27:07 -07:00
bazel_stamp_vars.js build: update matching regex for bazel stamping (#36523) 2020-04-08 11:04:08 -07:00
check-environment.js build: update to Node 10 (#25822) 2018-09-06 14:58:30 -07:00
defaults.bzl build: don't use deprecated $(location) pre-declared variable (#36308) 2020-03-31 11:02:56 -07:00
inline-package-json-deps.js build: remove rollup packaging from dev-infra (#35647) 2020-03-17 12:27:07 -07:00
jasmine-seed-generator.js test: run unit tests in random order (#19904) 2018-07-06 13:48:02 -07:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
ng_benchmark.bzl ci: do not run ng_benchmarks on CI (#34057) 2019-11-26 16:10:09 -08:00
postinstall-patches.js build: no longer run tslint from within gulp task (#35800) 2020-03-03 09:20:49 -08:00
rebase-pr.js ci: only lint commit messages in the PR (#35035) 2020-02-04 10:25:01 -08:00
tsconfig-test.json build(bazel): use fine-grained npm deps (#26111) (#26488) 2018-10-19 20:59:29 -07:00
tsconfig.json build: ts-api-guardian tsconfig warning with bazel (#27583) 2018-12-13 11:01:48 -08:00
types.d.ts build: no longer run tslint from within gulp task (#35800) 2020-03-03 09:20:49 -08:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00