jialh
2025-01-06 4d6d772771d2da54a4887d60f3b2ea21a72b3d7d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initLaunchwebview = void 0;
const shared_1 = require("@vue/shared");
function initLaunchwebview(manifestJson, pagesJson) {
    let entryPagePath = pagesJson.pages[0].path;
    // 依赖前置执行initArguments
    if (manifestJson.plus.arguments) {
        try {
            const args = JSON.parse(manifestJson.plus.arguments);
            if (args.path) {
                entryPagePath = args.path;
            }
        }
        catch (e) { }
    }
    manifestJson.plus.useragent.value = 'uni-app';
    (0, shared_1.extend)(manifestJson.plus.launchwebview, {
        id: '1',
        kernel: 'WKWebview',
    });
    // 首页为nvue
    const entryPage = pagesJson.pages.find((p) => p.path === entryPagePath);
    if (entryPage === null || entryPage === void 0 ? void 0 : entryPage.style.isNVue) {
        manifestJson.plus.launchwebview.uniNView = { path: entryPagePath + '.js' };
    }
    else {
        manifestJson.launch_path = '__uniappview.html';
    }
    return entryPagePath;
}
exports.initLaunchwebview = initLaunchwebview;