From 1b8ca2c45ef1de583d40e5f0cb7c83e3b745c101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Tue, 7 Jan 2025 16:35:48 +0800 Subject: [PATCH] chore: build uni-app-harmony --- packages/uni-app-harmony/dist/uni.compiler.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/uni-app-harmony/dist/uni.compiler.js b/packages/uni-app-harmony/dist/uni.compiler.js index f1405cd6d5..aa1a0a797e 100644 --- a/packages/uni-app-harmony/dist/uni.compiler.js +++ b/packages/uni-app-harmony/dist/uni.compiler.js @@ -85,6 +85,9 @@ function generateHarmonyImportSpecifier(id) { } }); } +function generateHarName(moduleName) { + return moduleName.replace(/@/g, '').replace(/\//g, '__').replace(/-/g, '_'); +} function generateHarmonyImportExternalCode(harmonyPackageNames) { return harmonyPackageNames .filter((harmonyPackageName) => isHarmonyGlobal(harmonyPackageName)) @@ -343,16 +346,13 @@ function initUniExtApi() { const depPath = './uni_modules/' + dep.plugin; dependencies[dep.moduleSpecifier] = depPath; modules.push({ - name: dep.moduleSpecifier - .replace(/@/g, '') - .replace(/\//g, '__') - .replace(/-/g, '_'), + name: generateHarName(dep.moduleSpecifier), srcPath: depPath, }); } else { if (!dependencies[dep.moduleSpecifier]) { - dependencies[dep.moduleSpecifier] = dep.version; + dependencies[dep.moduleSpecifier] = `./libs/${generateHarName(dep.moduleSpecifier)}.har`; } } });