!170 代码codecheck问题修改

Merge pull request !170 from 王曹宇/master
This commit is contained in:
openharmony_ci 2024-07-27 03:18:04 +00:00 committed by Gitee
commit e0ef13a9bf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -286,7 +286,7 @@ export function parseRequireModule (source, resourcePath) {
for (let requireStatement of requireStatements) {
const requireStatementExec = /\((\"|\')(.+)(\"|\')\)/.exec(requireStatement);
if (requireStatement.match(REG_SYSTEM) && requireStatementExec && requireStatementExec.length > 3) {
if (systemModules.length == 0 || systemModules.includes(requireStatementExec[2] + '.d.ts') ||
if (systemModules.length === 0 || systemModules.includes(requireStatementExec[2] + '.d.ts') ||
process.env.DEVICE_LEVEL === 'lite') {
source = source.replace(requireStatement, requireStatement.replace('require', 'requireModule'));
}