index.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. var __importDefault = (this && this.__importDefault) || function (mod) {
  26. return (mod && mod.__esModule) ? mod : { "default": mod };
  27. };
  28. Object.defineProperty(exports, "__esModule", { value: true });
  29. const path_1 = __importDefault(require("path"));
  30. const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
  31. const plugin_1 = require("./plugin");
  32. const css_1 = require("./plugins/css");
  33. const easycom_1 = require("./plugins/easycom");
  34. const inject_1 = require("./plugins/inject");
  35. const mainJs_1 = require("./plugins/mainJs");
  36. const manifestJson_1 = require("./plugins/manifestJson");
  37. const pagesJson_1 = require("./plugins/pagesJson");
  38. const postVue_1 = require("./plugins/postVue");
  39. const renderjs_1 = require("./plugins/renderjs");
  40. const resolveId_1 = require("./plugins/resolveId");
  41. const setup_1 = require("./plugins/setup");
  42. const ssr_1 = require("./plugins/ssr");
  43. const sourcemap_1 = require("./plugins/sourcemap");
  44. const vueCompilerDom = __importStar(require("@vue/compiler-dom"));
  45. const uniCliShared = __importStar(require("@dcloudio/uni-cli-shared"));
  46. exports.default = [
  47. ...(process.env.UNI_APP_X === 'true'
  48. ? [
  49. (0, uni_cli_shared_1.uniUTSUVueJavaScriptPlugin)(),
  50. (0, uni_cli_shared_1.resolveUTSCompiler)().uts2js({
  51. inputDir: process.env.UNI_INPUT_DIR,
  52. version: process.env.UNI_COMPILER_VERSION,
  53. cacheRoot: path_1.default.resolve(process.env.UNI_APP_X_CACHE_DIR ||
  54. path_1.default.resolve(process.env.UNI_OUTPUT_DIR, '../.web'), '.uts/cache'),
  55. modules: {
  56. vueCompilerDom,
  57. uniCliShared,
  58. },
  59. }),
  60. ]
  61. : []),
  62. (0, easycom_1.uniEasycomPlugin)({ exclude: uni_cli_shared_1.UNI_EASYCOM_EXCLUDE }),
  63. (0, uni_cli_shared_1.uniCssScopedPlugin)({
  64. filter: (id) => (0, uni_cli_shared_1.isVueSfcFile)(id) && !(0, uni_cli_shared_1.isAppVue)(id),
  65. }),
  66. (0, resolveId_1.uniResolveIdPlugin)(),
  67. (0, mainJs_1.uniMainJsPlugin)(),
  68. (0, manifestJson_1.uniManifestJsonPlugin)(),
  69. (0, pagesJson_1.uniPagesJsonPlugin)(),
  70. (0, inject_1.uniInjectPlugin)(),
  71. (0, css_1.uniCssPlugin)(),
  72. (0, ssr_1.uniSSRPlugin)(),
  73. (0, setup_1.uniSetupPlugin)(),
  74. (0, renderjs_1.uniRenderjsPlugin)(),
  75. (0, plugin_1.uniH5Plugin)(),
  76. (0, postVue_1.uniPostVuePlugin)(),
  77. (0, sourcemap_1.uniPostSourceMapPlugin)(),
  78. ];