שאלו את שאלתכם וקבלו סיכום של המסמך על ידי הפניה לדף הזה ולספק ה-AI שתבחרו
היסטוריית גרסאות
- "Init doc"v9.0.025.6.2026
התוכן של הדף הזה תורגם באמצעות AI.
צפייה בגרסה האחרונה של התוכן המקורי באנגליתאם יש לכם רעיון לשיפור התיעוד הזה, אל תהססו לתרום על ידי הגשת Pull Request ב-GitHub.
קישור GitHub לתיעודהעתקת ה-Markdown של המסמך ללוח
intlayerMinify
intlayerMinify is a Vite plugin that minifies compiled dictionary JSON files during a production build. It strips all unnecessary whitespace and, when combined with intlayerPrune, optionally renames content field names to short alphabetic aliases (a, b, c, …) to further reduce bundle size.
The plugin is already included and configured automatically when you use intlayer(). You only need to register it manually if you are composing the plugin stack yourself.
Usage
העתקת הקוד ללוח
Activation conditions
intlayerMinify is active only when all three of the following are true:
- The Vite command is
build(notserve/ dev). build.optimizeistrue(orundefined, which defaults totruefor builds).build.minifyistruein your Intlayer config.
When editor.enabled is true, the plugin still runs but skips field renaming: renaming rewrites the content keys the interpreter walks, so the keyPath the visual editor receives would no longer match the unmerged dictionaries it edits. Whitespace compaction and the top-level metadata strip stay active.
What gets minified
The plugin targets two dictionary locations (as resolved from intlayer.system):
dictionariesDir: static all-locale dictionaries (e.g..intlayer/dictionaries/*.json)dynamicDictionariesDir: per-locale dynamic dictionaries
Fetch-mode dictionaries (fetchDictionariesDir) are never minified because they are served from a remote API at runtime using their original field names. Renaming fields would create a mismatch between the server response and client-side property accesses.
Field-name mangling (property minification)
When intlayerPrune has analysed the codebase and populated pruneContext.dictionaryKeyToFieldRenameMap, intlayerMinify also renames content field names to short aliases. For example:
העתקת הקוד ללוח
The corresponding source-file property accesses are renamed by the Babel pass inside intlayerOptimize, so runtime behaviour is unchanged.
Internal Intlayer fields (nodeType, translation, etc.) are never renamed.
Edge-case dictionaries
Dictionaries flagged in pruneContext.dictionariesWithEdgeCases (structural anomalies detected during the prune phase) are skipped entirely, neither minified nor mangled, to avoid shipping broken data.
Qualified groups (collections / variants / meta records)
For dictionaries with a qualifierTypes array (collections, variants, and meta records), the plugin preserves the qualifierTypes array and the meta side-map verbatim. Only the content entries have their field names mangled. The composite keys (used for selector matching at runtime) are never touched.
