UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

58 lines (55 loc) 1.95 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: !0 }); }, __copyProps = (to, from, except, desc) => { if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); return to; }; var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); var fixDependenciesPlugin_exports = {}; __export(fixDependenciesPlugin_exports, { fixDependenciesPlugin: () => fixDependenciesPlugin }); module.exports = __toCommonJS(fixDependenciesPlugin_exports); var import_vxrn = require("vxrn"); function _type_of(obj) { "@swc/helpers - typeof"; return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj; } var hasAppliedOptimizePatches = !1; function fixDependenciesPlugin(options) { var patches = []; for (var key in options) { var value = options[key]; patches.push({ module: key, patchFiles: value && (typeof value > "u" ? "undefined" : _type_of(value)) === "object" ? value : { optimize: value } }); } return { name: "one-fix-dependencies", enforce: "pre", async config(config) { !hasAppliedOptimizePatches && patches.length && (hasAppliedOptimizePatches = !0, await (0, import_vxrn.applyOptimizePatches)(patches, config)); }, async configResolved(config) { await (0, import_vxrn.applyDependencyPatches)(patches, config); } }; } //# sourceMappingURL=fixDependenciesPlugin.native.js.map