HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
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/vhost/disk-apps/alq-cali.bikenow.co/node_modules/laravel-mix/src/components/Combine.js
const File = require('../File');
const Assert = require('../Assert');
const ConcatFilesTask = require('../tasks/ConcatenateFilesTask');
const { Component } = require('./Component');
const { concat } = require('lodash');

module.exports = class Combine extends Component {
    /**
     * The API name for the component.
     */
    name() {
        return ['combine', 'scripts', 'babel', 'styles', 'minify'];
    }

    /**
     * Register the component.
     *
     * @param {string|string[]} src
     * @param {string} [output]
     * @param {boolean} babel
     */
    register(src, output = '', babel = false) {
        // Do we need to perform compilation?
        babel = babel || this.caller === 'babel';

        const sources = concat([], src);
        const hasOutputPath = output !== undefined && output !== '';

        if (hasOutputPath) {
            this.context.addTask(
                this.createTask({
                    src: sources,
                    dst: output,
                    babel
                })
            );

            return;
        }

        if (this.caller !== 'minify') {
            throw new Error(
                `An output file path is required when using mix.${this.caller}()`
            );
        }

        // We've we're minifying an array of files then the output is the same as the input with a .min extension added
        for (const source of sources) {
            this.context.addTask(
                this.createTask({
                    src: source,
                    dst: source.replace(/\.([a-z]{2,})$/i, '.min.$1'),
                    babel
                })
            );
        }
    }

    /**
     * @param {object} param0
     * @param {string|string[]} param0.src
     * @param {string} param0.dst
     * @param {boolean} param0.babel
     */
    createTask({ src, dst, babel }) {
        const output = new File(dst);

        Assert.combine(src, output);

        return new ConcatFilesTask({
            src,
            output,
            babel,
            ignore: [output.relativePath()]
        });
    }
};