index.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. "use strict";
  2. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3. if (k2 === undefined) k2 = k;
  4. var desc = Object.getOwnPropertyDescriptor(m, k);
  5. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  6. desc = { enumerable: true, get: function() { return m[k]; } };
  7. }
  8. Object.defineProperty(o, k2, desc);
  9. }) : (function(o, m, k, k2) {
  10. if (k2 === undefined) k2 = k;
  11. o[k2] = m[k];
  12. }));
  13. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  14. Object.defineProperty(o, "default", { enumerable: true, value: v });
  15. }) : function(o, v) {
  16. o["default"] = v;
  17. });
  18. var __importStar = (this && this.__importStar) || function (mod) {
  19. if (mod && mod.__esModule) return mod;
  20. var result = {};
  21. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  22. __setModuleDefault(result, mod);
  23. return result;
  24. };
  25. Object.defineProperty(exports, "__esModule", { value: true });
  26. exports.init = void 0;
  27. const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
  28. const plugin_1 = require("./plugin");
  29. const mainUTS_1 = require("./mainUTS");
  30. const pre_1 = require("../pre");
  31. const manifestJson_1 = require("./manifestJson");
  32. const pagesJson_1 = require("./pagesJson");
  33. const vueCompilerDom = __importStar(require("@vue/compiler-dom"));
  34. const uniCliShared = __importStar(require("@dcloudio/uni-cli-shared"));
  35. function init() {
  36. return [
  37. (0, pre_1.uniPrePlugin)(),
  38. (0, uni_cli_shared_1.uniUTSUniModulesPlugin)({
  39. x: true,
  40. isSingleThread: process.env.UNI_APP_X_SINGLE_THREAD !== 'false',
  41. extApis: (0, uni_cli_shared_1.parseUniExtApiNamespacesOnce)(process.env.UNI_UTS_PLATFORM, process.env.UNI_UTS_TARGET_LANGUAGE),
  42. }),
  43. (0, uni_cli_shared_1.uniEasycomPlugin)({ exclude: uni_cli_shared_1.UNI_EASYCOM_EXCLUDE }),
  44. (0, plugin_1.uniAppIOSPlugin)(),
  45. (0, mainUTS_1.uniAppIOSMainPlugin)(),
  46. (0, manifestJson_1.uniAppManifestPlugin)(),
  47. (0, pagesJson_1.uniAppPagesPlugin)(),
  48. (0, uni_cli_shared_1.uniUTSUVueJavaScriptPlugin)(),
  49. (0, uni_cli_shared_1.resolveUTSCompiler)().uts2js({
  50. inputDir: process.env.UNI_INPUT_DIR,
  51. version: process.env.UNI_COMPILER_VERSION,
  52. modules: {
  53. vueCompilerDom,
  54. uniCliShared,
  55. },
  56. }),
  57. ];
  58. }
  59. exports.init = init;