Skip to content

Commit bef89a9

Browse files
committed
wip(x-ios): 启用 uniSharedDataPlugin 插件
1 parent 5ca4e13 commit bef89a9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/uni-app-uts/src/plugins/ios/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
uniEncryptUniModulesAssetsPlugin,
1212
uniEncryptUniModulesPlugin,
1313
uniHBuilderXConsolePlugin,
14+
uniSharedDataPlugin,
1415
uniUTSAppUniModulesPlugin,
1516
uniUTSUVueJavaScriptPlugin,
1617
uniUniModulesExtApiPlugin,
@@ -26,6 +27,7 @@ import { uniAppPagesPlugin } from '../js/pagesJson'
2627
import { replaceExtApiPagePaths } from '../js/extApiPages'
2728

2829
export function init() {
30+
const isDom2 = process.env.UNI_APP_X_DOM2 === 'true'
2931
return [
3032
...(isNormalCompileTarget()
3133
? [uniWorkersPlugin(), uniDecryptUniModulesPlugin()]
@@ -53,6 +55,7 @@ export function init() {
5355
]),
5456
uniUTSUVueJavaScriptPlugin(),
5557
resolveUTSCompiler().uts2js({
58+
dom2: isDom2,
5659
platform: 'app-ios',
5760
inputDir: process.env.UNI_INPUT_DIR,
5861
version: process.env.UNI_COMPILER_VERSION,
@@ -68,6 +71,7 @@ export function init() {
6871
},
6972
},
7073
}),
74+
...(isDom2 ? [uniSharedDataPlugin()] : []),
7175
...(process.env.UNI_COMPILE_EXT_API_TYPE === 'pages'
7276
? [replaceExtApiPagePaths()]
7377
: []),

packages/uni-cli-shared/src/dom2/sharedData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export function uniSharedDataPlugin(): Plugin {
77
const { USDP } = requireUniHelpers()
88
const compiler = require('@dcloudio/compiler-vapor-dom2')
99
return USDP({
10+
platform: process.env.UNI_UTS_PLATFORM!,
1011
compilerVaporDom2: compiler,
1112
utsCompiler: resolveUTSCompiler(),
1213
isUniPageFile,

0 commit comments

Comments
 (0)