PJR*_*bot 3 javascript typescript reactjs formatjs create-react-app
使用Create React App和 TypeScript 时,会在目录中自动生成一个文件src:react-app-env.d.ts. 该文件似乎需要支持图像导入,如下所述: https: //github.com/facebook/create-react-app/issues/6560。
使用Format.JS时,我使用以下命令提取消息:
yarn extract 'src/**/*.ts*' --out-file lang/en-GB.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'
Run Code Online (Sandbox Code Playgroud)
但不幸的是这会导致这个错误:
warning Error: Error processing file src/react-app-env.d.ts
Debug Failure. Output generation failed
Done in 9.64s.
Run Code Online (Sandbox Code Playgroud)
我需要处理 .ts 和 .tsx 文件。我试图破解搜索模式以排除特定的文件名,但我现在完全被难住了,因为我不确定其精确的规范。
作为解决方法,我可以在提取之前删除该文件,但这非常烦人!