From aa271556186a61c261908c1ca6a3c95b9259d491 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 13 Apr 2018 09:55:36 -0700 Subject: [PATCH] build(common): mark locales files as side-effect-full (#23366) These files are in the UMD format for greater portablity, and as such can't be marked as side-effect-free by webpack/build-optimizer/uglify. PR Close #23366 --- packages/common/locales/BUILD.bazel | 1 + packages/common/locales/package.json | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 packages/common/locales/package.json diff --git a/packages/common/locales/BUILD.bazel b/packages/common/locales/BUILD.bazel index 8691c75962..2c330e32ac 100644 --- a/packages/common/locales/BUILD.bazel +++ b/packages/common/locales/BUILD.bazel @@ -13,6 +13,7 @@ ts_library( npm_package( name = "package", + srcs = ["package.json"], replacements = { # Workaround for https://github.com/angular/angular/issues/23217 # Webpack will detect that the UMD outputs from TypeScript pass the diff --git a/packages/common/locales/package.json b/packages/common/locales/package.json new file mode 100644 index 0000000000..6baf80d756 --- /dev/null +++ b/packages/common/locales/package.json @@ -0,0 +1,4 @@ +{ + "description": "This directory contains UMD files which by its nature are not side-effect free. The parent package.json marks the whole @angular/common package as side-effect free, so if this directory is not excluded from that, build-optimizer will mark the contents as side-effect free and uglify will incorrectly remove all needed localization code.", + "sideEffects": false +}