Skip to content

Commit

Permalink
build(common): mark locales files as side-effect-full (#23366)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
IgorMinar committed Apr 13, 2018
1 parent eac36d7 commit aa27155
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/common/locales/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/common/locales/package.json
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit aa27155

Please sign in to comment.