/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/taro-platform-harmony-cpp/scripts/reference.ts
21 строка
709 B
ZakaryCode
feat(harmony): add cpp plugin
13 мар 2025, 16:58
13 мар 2025, 16:58
9a04a67
Код
Авторство
О чём код?
import path from 'node:path' import { fs } from '@tarojs/helper' // 指定要处理的目录路径 const directoryPath = path.join(__dirname, '../../../harmony_library/library/src/main/ets/npm/@tarojs/runtime/dist') function removeReference(filePath: string) { const stat = fs.lstatSync(filePath) if (stat.isDirectory()) { fs.readdirSync(filePath).forEach(file => { removeReference(path.join(filePath, file)) }) } else if (filePath.endsWith('.d.ts')) { const content = fs.readFileSync(filePath, 'utf8') const modifiedContent = content.replace(/\/\/\/\s*<reference\s+.*\/>\s*\n/g, '') fs.writeFileSync(filePath, modifiedContent, 'utf8') } } removeReference(directoryPath)