Skip to content

Reproduction repository to showcase tree-shaking problems when using decorators.

Notifications You must be signed in to change notification settings

fischeversenker/ng-decorator-tree-shaking

Repository files navigation

NgDecoratorTreeShaking

Reproduction repository to showcase problems with tree-shaking of i18n extractions.

This repository contains:

  • a library at /projects/my-library. This library contains and exports a single module/component.
  • a library at /projects/library-with-localize. This library contains and exports a single module/component.
  • an application at /src/.... It imports the library modules in the app.module.ts but does not use the exported library components anywhere.

Problem

Unused translation strings are included in the apps extracted translations. It seems like only translations are included from files that don't explicitly import and use the $localize function.

Reproduction steps

# install dependencies
yarn install

# build the libraries
yarn ng build my-library && yarn ng build library-with-localize

# extract translations
yarn ng extract-i18n

Now confirm that the generated messages.xlf file contains unused translations from only these components that don't explicitly import and use $localize.

About

Reproduction repository to showcase tree-shaking problems when using decorators.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published