"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const string_decoder_1 = require("string_decoder");
const factory_1 = __importDefault(require("./factory"));
const esbuild = require("esbuild");
const serialize = (path) => {
    const decoder = new string_decoder_1.StringDecoder();
    const preparedFarbic = factory_1.default(path);
    fs_1.default.writeFileSync("__out.ts", preparedFarbic, "utf-8");
    const result = esbuild.buildSync({
        entryPoints: ["__out.ts"],
        bundle: true,
        platform: "node",
        write: false,
        external: ["pg-native"],
    });
    fs_1.default.unlinkSync("__out.ts");
    return eval(decoder.write(result.outputFiles[0].contents));
};
exports.default = serialize;
//# sourceMappingURL=index.js.map