From be406820c04add25994fe8235f19b5665ff36ffb Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Wed, 8 Jul 2026 12:03:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(mp-alipay):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E5=88=86=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-mp-alipay/src/compiler/options.ts | 1 + packages/uni-mp-alipay/src/runtime/index.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/uni-mp-alipay/src/compiler/options.ts b/packages/uni-mp-alipay/src/compiler/options.ts index af72796bae..0ce7fa518a 100644 --- a/packages/uni-mp-alipay/src/compiler/options.ts +++ b/packages/uni-mp-alipay/src/compiler/options.ts @@ -166,6 +166,7 @@ export const options: UniMiniProgramPluginOptions = { app: { darkmode: false, subpackages: true, + independentSubpackages: true, plugins: true, usingComponents: true, normalize(appJson) { diff --git a/packages/uni-mp-alipay/src/runtime/index.ts b/packages/uni-mp-alipay/src/runtime/index.ts index 47988f0057..0f8d49aa19 100644 --- a/packages/uni-mp-alipay/src/runtime/index.ts +++ b/packages/uni-mp-alipay/src/runtime/index.ts @@ -2,6 +2,7 @@ import { EventChannel } from '@dcloudio/uni-shared' import { initCreateApp, + initCreateIndependentSubpackageApp, initCreatePluginApp, initCreateSubpackageApp, } from '@dcloudio/uni-mp-core' @@ -17,9 +18,12 @@ export const createPage = initCreatePage() export const createComponent = initCreateComponent() export const createPluginApp = initCreatePluginApp(parseAppOptions) export const createSubpackageApp = initCreateSubpackageApp(parseAppOptions) +export const createIndependentSubpackageApp = + initCreateIndependentSubpackageApp() ;(my as any).EventChannel = EventChannel ;(my as any).createApp = createApp ;(my as any).createPage = createPage ;(my as any).createComponent = createComponent ;(my as any).createPluginApp = createPluginApp ;(my as any).createSubpackageApp = createSubpackageApp +;(my as any).createIndependentSubpackageApp = createIndependentSubpackageApp From 3d81f598865bcec9f343f4a4de14a61ab12c89a5 Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Thu, 9 Jul 2026 11:55:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(mp-alipay):=20=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E5=88=86=E5=8C=85=E8=A6=86=E7=9B=96=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=88=9B=E5=BB=BA=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-mp-alipay/src/runtime/index.ts | 23 ++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/uni-mp-alipay/src/runtime/index.ts b/packages/uni-mp-alipay/src/runtime/index.ts index 0f8d49aa19..655934311e 100644 --- a/packages/uni-mp-alipay/src/runtime/index.ts +++ b/packages/uni-mp-alipay/src/runtime/index.ts @@ -13,6 +13,9 @@ import * as parseAppOptions from './parseAppOptions' import { initCreatePage } from './createPage' import { initCreateComponent } from './createComponent' + +declare const __UNI_MP_INDEPENDENT_RUNTIME__: boolean + export const createApp = initCreateApp(parseAppOptions) export const createPage = initCreatePage() export const createComponent = initCreateComponent() @@ -20,10 +23,16 @@ export const createPluginApp = initCreatePluginApp(parseAppOptions) export const createSubpackageApp = initCreateSubpackageApp(parseAppOptions) export const createIndependentSubpackageApp = initCreateIndependentSubpackageApp() -;(my as any).EventChannel = EventChannel -;(my as any).createApp = createApp -;(my as any).createPage = createPage -;(my as any).createComponent = createComponent -;(my as any).createPluginApp = createPluginApp -;(my as any).createSubpackageApp = createSubpackageApp -;(my as any).createIndependentSubpackageApp = createIndependentSubpackageApp + +const isIndependentRuntime = + typeof __UNI_MP_INDEPENDENT_RUNTIME__ !== 'undefined' && + __UNI_MP_INDEPENDENT_RUNTIME__ === true +if (!isIndependentRuntime) { + ;(my as any).EventChannel = EventChannel + ;(my as any).createApp = createApp + ;(my as any).createPage = createPage + ;(my as any).createComponent = createComponent + ;(my as any).createPluginApp = createPluginApp + ;(my as any).createSubpackageApp = createSubpackageApp + ;(my as any).createIndependentSubpackageApp = createIndependentSubpackageApp +}