Skip to content

Commit

Permalink
fix(harmony): 修改判断.d.ts的正则,修复正常d结尾文件被识别成类型文件的问题 (NervJS#17216)
Browse files Browse the repository at this point in the history
Co-authored-by: mayintao3 <mayintao3@jd.com>
Co-authored-by: Shijie Yu <yushijiechn@qq.com>
  • Loading branch information
3 people authored and ianzone committed Feb 28, 2025
1 parent 128ef47 commit 0861590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-platform-harmony/src/program/arkTS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default class Harmony extends TaroPlatformHarmony {
define.global = 'globalThis'
}
const ext = path.extname(target)
if (![/d\.e?tsx?$/, /\.(json|map|md)$/].some(e => e.test(target))) {
if (![/\.d\.e?tsx?$/, /\.(json|map|md)$/].some(e => e.test(target))) {
code = this.replaceDefineValue(code, define, ext)
}
if (['.ts'].includes(ext)) {
Expand Down

0 comments on commit 0861590

Please sign in to comment.