launchwebview.js 1.0 KB

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