Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.harmony.js文件不生效 process.env.TARO_ENV === 'rn' 里面的require()仍然会被执行 #16853

Open
ShaoGongBra opened this issue Nov 12, 2024 · 0 comments

Comments

@ShaoGongBra
Copy link
Contributor

相关平台

鸿蒙

使用框架: React

复现步骤

if (process.env.TARO_ENV === 'rn') {
  font.loadLocal('TestIcon', require('./TestIcon.ttf'))
}

里面的代码不会被执行,但是reuqire会被执行

多端文件 index.harmony.js文件不会被加载 只会加载 index.js文件

期望结果

1

实际结果

2

环境信息

Taro CLI 3.6.35 environment info:
@tarojs/plugin-platform-harmony-ets: 4.0.7 => 4.0.7
This was referenced Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant