You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After having included @abp/ng.core for Angular 9/10, ng build --prod produces a lot of _locale*.js files. I use ngsw and had *.js as a prefetch method, resulting in all locales to be prefetched. I wonder why this many locale files are produced. Can I prevent this or disable this? My app localizes everything from the backend, and I wont probably switch from English anyway as my client does not require localization.
(Or is this an optimization bailout issue and thus not expected behaviour?)
The text was updated successfully, but these errors were encountered:
davidzwa
changed the title
Angular build includes many _locale*.js file
Angular build includes many unexpected _locale*.js files
Aug 5, 2020
Hi! Today i was upgrading ng.abp from 2.9.x to 3.0.5, and then doing a serve/build has a lot of chunk map of _locale, like @davidzwa . Why this change?
Many locale files are created as chunk, but as of v3.3, just 10 (ar, cs, en, fr, pt, tr, ru, sl, zl-Hans, zh-Hant) chunks will be created. If the locale of the language you are using is not one of these locales, you should import its locale file in app.module like below:
// nl.js will include the main bundle.
import { storeLocaleData } from '@abp/ng.core';
import(
/* webpackChunkName: "_locale-nl-js"*/
/* webpackMode: "eager" */
'@angular/common/locales/nl.js'
).then(m => storeLocaleData(m.default, 'nl'));
Note: If the Language Management (commercial) module is installed in your project, close to 500 chunks are still being created.
Description:
After having included @abp/ng.core for Angular 9/10,
ng build --prod
produces a lot of _locale*.js files. I use ngsw and had*.js
as a prefetch method, resulting in all locales to be prefetched. I wonder why this many locale files are produced. Can I prevent this or disable this? My app localizes everything from the backend, and I wont probably switch from English anyway as my client does not require localization.(Or is this an optimization bailout issue and thus not expected behaviour?)
The text was updated successfully, but these errors were encountered: