Optimize

This library provides the following features:

  • AOT translation file flattening

  • Removal of translator comments

  • JSON file minification

Installation

pnpm add @jsverse/transloco-optimize --save-dev

Usage

  1. Make the optimizer run after building

Create the following task in your project.json configuration file:

{
  "name": "my-app", 
  ...,
  "targets": {
    "transloco:optimize": {
      "command": "transloco-optimize {workspaceRoot}/dist/my-app/assets/i18n"
    }
  }
}

  1. In your Transloco configuration, add the following setting:

Alternatively, if you have some custom pipeline, you can just import it as a function:

Was this helpful?