|
| 1 | +import type { GeneratorOptions } from "@babel/core" |
1 | 2 | import path from "path" |
2 | 3 | import fs from "fs" |
3 | 4 | import chalk from "chalk" |
@@ -34,7 +35,7 @@ export type LinguiConfig = { |
34 | 35 | catalogs: CatalogConfig[] |
35 | 36 | compileNamespace: string |
36 | 37 | extractBabelOptions: Record<string, unknown> |
37 | | - compilerBabelOptions: Record<string, unknown> |
| 38 | + compilerBabelOptions: GeneratorOptions |
38 | 39 | fallbackLocales?: FallbackLocales |
39 | 40 | format: CatalogFormat |
40 | 41 | formatOptions: CatalogFormatOptions |
@@ -66,7 +67,12 @@ export const defaultConfig: LinguiConfig = { |
66 | 67 | ], |
67 | 68 | catalogsMergePath: "", |
68 | 69 | compileNamespace: "cjs", |
69 | | - compilerBabelOptions: {}, |
| 70 | + compilerBabelOptions: { |
| 71 | + minified: true, |
| 72 | + jsescOption: { |
| 73 | + minimal: true, |
| 74 | + } |
| 75 | + }, |
70 | 76 | extractBabelOptions: { plugins: [], presets: [] }, |
71 | 77 | fallbackLocales: {}, |
72 | 78 | format: "po", |
@@ -266,7 +272,7 @@ export function replaceRootDir( |
266 | 272 | } else if (typeof value === "string") { |
267 | 273 | return replace(value) |
268 | 274 | } else if (Array.isArray(value)) { |
269 | | - return value.map((item) => replaceDeep(item, rootDir)) as any |
| 275 | + return (value as any).map((item) => replaceDeep(item, rootDir)) |
270 | 276 | } else if (typeof value === "object") { |
271 | 277 | Object.keys(value).forEach((key) => { |
272 | 278 | const newKey = replaceDeep(key, rootDir) |
|
0 commit comments