packages/okam-build/lib/processor/helper/builtin.js
function overrideProcessor(existedProcessor, extnameProcessorMap, opts) {
    let oldExtnames;
    let newExtnames;
    Object.keys(opts).forEach(k => {
        let v = opts[k];
        if (!v) {
            return;
        }

        if (k === 'extnames') {
            oldExtnames = existedProcessor[k];
            newExtnames = v;
        }

        if (k === 'hook') {
            v = overrideObjectFunctions(v, existedProcessor[k]);
        }

        existedProcessor[k] = v;
    });

    let processor = opts.processor;
    if (processor) {
        existedProcessor.processor = resolveProcessor(processor);
    }

    let processorName = opts.name;
    removeFileExtnameAssociatedProcessor(
        oldExtnames, processorName, extnameProcessorMap
    );
    addFileExtnameAssociatedProcessor(newExtnames, processorName, extnameProcessorMap);
}
function overrideProcessor(existedProcessor, extnameProcessorMap, opts) {
    let oldExtnames;
    let newExtnames;
    Object.keys(opts).forEach(k => {
        let v = opts[k];
        if (!v) {
            return;
        }

        if (k === 'extnames') {
            oldExtnames = existedProcessor[k];
            newExtnames = v;
        }

        if (k === 'hook') {
            v = overrideObjectFunctions(v, existedProcessor[k]);
        }

        existedProcessor[k] = v;
    });

    let processor = opts.processor;
    if (processor) {
        existedProcessor.processor = resolveProcessor(processor);
    }

    let processorName = opts.name;
    removeFileExtnameAssociatedProcessor(
        oldExtnames, processorName, extnameProcessorMap
    );
    addFileExtnameAssociatedProcessor(newExtnames, processorName, extnameProcessorMap);
}
Override the builtin processor definition

@inner
@param {Object} existedProcessor the builtin existed processor config
@param {Object} extnameProcessorMap the file extname associated processors map
@param {Object} opts the override options