File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 ],
3535 "devDependencies" : {
3636 "ts-node" : " ^10.9.1"
37+ },
38+ "peerDependencies" : {
39+ "ts-node" : " >=10" ,
40+ "typescript" : " >=4"
41+ },
42+ "peerDependenciesMeta" : {
43+ "ts-node" : {
44+ "optional" : true
45+ },
46+ "typescript" : {
47+ "optional" : true
48+ }
3749 }
3850}
Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ import type { GeneratorOptions } from "@babel/core"
22import path from "path"
33import fs from "fs"
44import chalk from "chalk"
5- import { cosmiconfigSync } from "cosmiconfig"
5+ import { cosmiconfigSync , type LoaderSync } from "cosmiconfig"
66import { multipleValidOptions , validate } from "jest-validate"
7- import { TypeScriptLoader } from "cosmiconfig-typescript-loader" ;
87
98export type CatalogFormat = "lingui" | "minimal" | "po" | "csv"
109
@@ -104,6 +103,19 @@ function configExists(path) {
104103 return path && fs . existsSync ( path )
105104}
106105
106+ function TypeScriptLoader ( ) : LoaderSync {
107+ let loaderInstance : LoaderSync
108+ return ( filepath , content ) => {
109+ if ( ! loaderInstance ) {
110+ const { TypeScriptLoader } =
111+ require ( "cosmiconfig-typescript-loader" ) as typeof import ( "cosmiconfig-typescript-loader" )
112+ loaderInstance = TypeScriptLoader ( )
113+ }
114+
115+ return loaderInstance ( filepath , content )
116+ }
117+ }
118+
107119export function getConfig ( {
108120 cwd,
109121 configPath,
You can’t perform that action at this time.
0 commit comments