UNPKG

vite-plugin-zephyr

Version:

Vite plugin for Zephyr

69 lines (68 loc) • 3.23 kB
"use strict"; var __webpack_require__ = {}; (()=>{ __webpack_require__.d = (exports1, getters, values)=>{ var define = (defs, kind)=>{ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, { enumerable: true, [kind]: defs[key] }); }; define(getters, "get"); define(values, "value"); }; })(); (()=>{ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop); })(); (()=>{ __webpack_require__.r = (exports1)=>{ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, { value: 'Module' }); Object.defineProperty(exports1, '__esModule', { value: true }); }; })(); var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { extractEntrypoint: ()=>extractEntrypoint }); const external_zephyr_agent_namespaceObject = require("zephyr-agent"); const normalize_entrypoint_js_namespaceObject = require("../utils/normalize-entrypoint.js"); function extractEntrypoint(config) { const input = config.build?.rollupOptions?.input; if (input) { if ('string' == typeof input) { external_zephyr_agent_namespaceObject.ze_log.init(`Detected entrypoint from Vite config: ${input}`); return (0, normalize_entrypoint_js_namespaceObject.normalizeEntrypoint)(input); } if ('object' == typeof input && !Array.isArray(input)) { const entries = Object.entries(input); if (entries.length > 0) { const [firstKey, firstValue] = entries[0]; if (entries.length > 1) external_zephyr_agent_namespaceObject.ze_log.init(`Multiple entrypoints detected (${entries.length}). Using first: ${firstKey} -> ${firstValue}`); else external_zephyr_agent_namespaceObject.ze_log.init(`Detected entrypoint from Vite config: ${firstKey} -> ${firstValue}`); return (0, normalize_entrypoint_js_namespaceObject.normalizeEntrypoint)(String(firstValue)); } } if (Array.isArray(input) && input.length > 0) { const firstEntry = input[0]; if (input.length > 1) external_zephyr_agent_namespaceObject.ze_log.init(`Multiple entrypoints detected (${input.length}). Using first: ${firstEntry}`); else external_zephyr_agent_namespaceObject.ze_log.init(`Detected entrypoint from Vite config: ${firstEntry}`); return (0, normalize_entrypoint_js_namespaceObject.normalizeEntrypoint)(String(firstEntry)); } } external_zephyr_agent_namespaceObject.ze_log.init('No entrypoint specified, using Vite default: index.html'); return 'index.html'; } exports.extractEntrypoint = __webpack_exports__.extractEntrypoint; for(var __rspack_i in __webpack_exports__)if (-1 === [ "extractEntrypoint" ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i]; Object.defineProperty(exports, '__esModule', { value: true }); //# sourceMappingURL=extract-entrypoint.js.map