HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/api-storage/node_modules/@swc/cli/lib/spack/index.js
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
const _core = require("@swc/core");
const _fs = require("fs");
const _path = require("path");
const _util = require("util");
const _options = /*#__PURE__*/ _interop_require_default(require("./options"));
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const write = (0, _util.promisify)(_fs.writeFile);
const makeDir = (0, _util.promisify)(_fs.mkdir);
(async ()=>{
    const { spackOptions } = await (0, _options.default)(process.argv);
    function isUserDefinedEntry(name) {
        if (typeof spackOptions.entry === "string") {
            return spackOptions.entry === name;
        }
        if (Array.isArray(spackOptions.entry)) {
            for (const e of spackOptions.entry){
                if (e === name) {
                    return true;
                }
            }
            return false;
        }
        return name in spackOptions.entry;
    }
    async function build() {
        var _spackOptions_output;
        const bundleStart = process.hrtime();
        const output = await (0, _core.bundle)(spackOptions);
        const bundleEnd = process.hrtime(bundleStart);
        console.info(`Bundling done: ${bundleEnd[0]}s ${bundleEnd[1] / 1000000}ms`);
        const emitStart = process.hrtime();
        if ((_spackOptions_output = spackOptions.output) === null || _spackOptions_output === void 0 ? void 0 : _spackOptions_output.path) {
            await Object.keys(output).map(async (name)=>{
                let fullPath = "";
                if (isUserDefinedEntry(name)) {
                    fullPath = (0, _path.join)(spackOptions.output.path, spackOptions.output.name.replace("[name]", name));
                } else {
                    const ext = (0, _path.extname)(name);
                    const base = (0, _path.basename)(name, ext);
                    const filename = (0, _path.relative)(process.cwd(), name);
                    fullPath = (0, _path.join)(spackOptions.output.path, (0, _path.dirname)(filename), `${base}.js`);
                }
                await makeDir((0, _path.dirname)(fullPath), {
                    recursive: true
                });
                await write(fullPath, output[name].code, "utf-8");
                if (output[name].map) {
                    await write(`${fullPath}.map`, output[name].map, "utf-8");
                }
            });
        } else {
            throw new Error("Cannot print to stdout: not implemented yet");
        }
        const emitEnd = process.hrtime(emitStart);
        console.info(`Done: ${emitEnd[0]}s ${emitEnd[1] / 1000000}ms`);
    }
    // if (cliOptions.watch) {
    //     throw new Error('watch is not implemented yet')
    // }
    await build();
})();

//# sourceMappingURL=index.js.map