"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = function(target, all) { for(var name in all)__defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = function(to, from, except, desc) { if (from && typeof from === "object" || typeof from === "function") { var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { var _loop = function() { var key = _step.value; if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: function() { return from[key]; }, enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); }; for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop(); } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } } return to; }; var __toCommonJS = function(mod) { return __copyProps(__defProp({}, "__esModule", { value: true }), mod); }; // src/plugin.ts var plugin_exports = {}; __export(plugin_exports, { default: function() { return plugin_default; } }); module.exports = __toCommonJS(plugin_exports); var import_core = require("@babel/core"); var plugin_default = { name: "vite:relay", transform: function transform(src, id) { if (/.(t|j)sx?/.test(id) && src.includes("graphql`")) { var out = (0, import_core.transformSync)(src, { plugins: [ [ "babel-plugin-relay" ] ], code: true, filename: id, sourceMaps: true }); if (!(out === null || out === void 0 ? void 0 : out.code)) { throw new Error("vite-plugin-relay: Failed to transform ".concat(id)); } var code = out.code; var map = out.map; return { code: code, map: map }; } } };