UNPKG

beesbuild

Version:

构建工具链

86 lines (85 loc) 3.2 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var stdin_exports = {}; __export(stdin_exports, { vuePlugin: () => vuePlugin }); module.exports = __toCommonJS(stdin_exports); var import_rollup = __toESM(require("unplugin-vue-macros/rollup")); var import_plugin_vue = __toESM(require("@vitejs/plugin-vue")); var import_plugin_vue_jsx = __toESM(require("@vitejs/plugin-vue-jsx")); var import_lodash_unified = require("lodash-unified"); function vuePlugin(options, ctx) { var _a, _b, _c, _d; if (((_a = options == null ? void 0 : options.vue) != null ? _a : false) === false) return []; options = { ...options }; if (typeof (options == null ? void 0 : options.vueJsx) === "boolean") { options.vueJsx = {}; } if (typeof (options == null ? void 0 : options.vue) === "boolean") { options.vue = {}; } if ((0, import_lodash_unified.isBoolean)(options == null ? void 0 : options.vueJsx)) { options.vueJsx = {}; } const vueJsxPlugin = (0, import_plugin_vue_jsx.default)((_b = options == null ? void 0 : options.vueJsx) != null ? _b : {}); const vueOptions = (0, import_lodash_unified.mergeWith)({ isProduction: true, template: { compilerOptions: { hoistStatic: false, cacheHandlers: false } } }, (_c = options == null ? void 0 : options.vue) != null ? _c : {}); const vuePlugin2 = (0, import_plugin_vue.default)(vueOptions); const plugins = { vue: vuePlugin2, vueJsx: vueJsxPlugin }; const config = (0, import_lodash_unified.mergeWith)({}, { root: ctx.options.rootDir, setupComponent: false, setupSFC: false, plugins }, (_d = options == null ? void 0 : options.vueMacros) != null ? _d : {}); return (0, import_rollup.default)(config); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { vuePlugin });