有什么方法可以从构建中排除不需要的语言环境(ngx-bootstrap / chronos)?

时间:2019-07-02 08:45:53

标签: angular ngx-bootstrap

我使用ngx-bootstrap和日期选择器。我发现在chronos中包含的ngx-bootstrap中,最终版本中有很多不需要的语言环境(〜25 langs)定义: node_modules/ngx-bootstrap/locale/public_api.d.ts

export { arLocale } from 'ngx-bootstrap/chronos';
export { bgLocale } from 'ngx-bootstrap/chronos';
export { caLocale } from 'ngx-bootstrap/chronos';
export { csLocale } from 'ngx-bootstrap/chronos';
export { daLocale } from 'ngx-bootstrap/chronos';
export { deLocale } from 'ngx-bootstrap/chronos';
export { enGbLocale } from 'ngx-bootstrap/chronos';
export { esDoLocale } from 'ngx-bootstrap/chronos';
export { esLocale } from 'ngx-bootstrap/chronos';
export { esUsLocale } from 'ngx-bootstrap/chronos';
export { fiLocale } from 'ngx-bootstrap/chronos';
export { frLocale } from 'ngx-bootstrap/chronos';
export { glLocale } from 'ngx-bootstrap/chronos';
export { heLocale } from 'ngx-bootstrap/chronos';
export { hiLocale } from 'ngx-bootstrap/chronos';
export { huLocale } from 'ngx-bootstrap/chronos';
export { idLocale } from 'ngx-bootstrap/chronos';
export { itLocale } from 'ngx-bootstrap/chronos';
export { jaLocale } from 'ngx-bootstrap/chronos';
export { koLocale } from 'ngx-bootstrap/chronos';
export { ltLocale } from 'ngx-bootstrap/chronos';
export { mnLocale } from 'ngx-bootstrap/chronos';
export { nbLocale } from 'ngx-bootstrap/chronos';
export { nlBeLocale } from 'ngx-bootstrap/chronos';
export { nlLocale } from 'ngx-bootstrap/chronos';
export { plLocale } from 'ngx-bootstrap/chronos';
export { ptBrLocale } from 'ngx-bootstrap/chronos';
export { roLocale } from 'ngx-bootstrap/chronos';
export { ruLocale } from 'ngx-bootstrap/chronos';
export { skLocale } from 'ngx-bootstrap/chronos';
export { slLocale } from 'ngx-bootstrap/chronos';
export { svLocale } from 'ngx-bootstrap/chronos';
export { thLocale } from 'ngx-bootstrap/chronos';
export { trLocale } from 'ngx-bootstrap/chronos';
export { zhCnLocale } from 'ngx-bootstrap/chronos';

在我的应用中,我仅使用英语,因此我想从最终版本中删除所有其他语言环境定义。

有什么办法可以实现分叉仓库和修改现有代码?

1 个答案:

答案 0 :(得分:0)

当我运行--prod构建并打开构建优化器时,将删除所有未使用的语言环境。