fix localization build (#500)
* fix localization build Signed-off-by: Ke Xu <xuke@microsoft.com> * remove junk Signed-off-by: Ke Xu <xuke@microsoft.com>
This commit is contained in:
Родитель
3884e207c1
Коммит
1a0da3563f
|
@ -9,8 +9,12 @@ import { mapValues, merge } from "lodash";
|
|||
|
||||
import { Language } from "./Language";
|
||||
|
||||
type NestedPartial<T> = {
|
||||
[P in keyof T]?: T[P] | NestedPartial<T[P]>;
|
||||
};
|
||||
|
||||
export type ILocalizationConfig<T> = { en: T } & {
|
||||
readonly [key in Language]: any;
|
||||
readonly [key in Language]: NestedPartial<T>;
|
||||
};
|
||||
|
||||
export type ILocalization<T> = Omit<LocalizedStrings<T>, "formatString"> & {
|
||||
|
@ -25,7 +29,7 @@ export function getLocalization<T>(
|
|||
): ILocalization<T> {
|
||||
const localization = new LocalizedStringsClass(
|
||||
mapValues(lang, (v) => merge({}, lang.en, v))
|
||||
);
|
||||
) as ILocalization<T>;
|
||||
const originalFormat = localization.formatString.bind(localization);
|
||||
localization.formatString = (
|
||||
str: string,
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
const nrwlConfig = require("@nrwl/react/plugins/bundle-rollup");
|
||||
const json = require("@rollup/plugin-json");
|
||||
const svgr = require("@svgr/rollup");
|
||||
|
||||
module.exports = (config) => {
|
||||
config = nrwlConfig(config);
|
||||
|
||||
config.context = "window";
|
||||
config.plugins.push(json());
|
||||
config.plugins.push(svgr.default());
|
||||
config.onwarn = (warning, warn) => {
|
||||
if (
|
||||
|
|
Загрузка…
Ссылка в новой задаче