packages/okam-build/lib/processor/index.js
function processFile(file, processor, buildManager) {
    let {compileContext, logger} = buildManager;
    let {handler, options: opts, rext} = processor;
    logger.debug(`compile file ${file.path}, using ${processor.name}: `, opts);

    let result = handler(file, Object.assign({
        config: opts
    }, compileContext));
    if (!result) {
        return;
    }

    rext && (file.rext = rext);

    if (isPromise(result)) {
        buildManager.addAsyncTask(file, result);
        return;
    }

    if (result.isSfcComponent) {
        compileComponent(result, file, buildManager);
        result = {content: file.content};
    }
    buildManager.updateFileCompileResult(file, result);
}
function processFile(file, processor, buildManager) {
    let {compileContext, logger} = buildManager;
    let {handler, options: opts, rext} = processor;
    logger.debug(`compile file ${file.path}, using ${processor.name}: `, opts);

    let result = handler(file, Object.assign({
        config: opts
    }, compileContext));
    if (!result) {
        return;
    }

    rext && (file.rext = rext);

    if (isPromise(result)) {
        buildManager.addAsyncTask(file, result);
        return;
    }

    if (result.isSfcComponent) {
        compileComponent(result, file, buildManager);
        result = {content: file.content};
    }
    buildManager.updateFileCompileResult(file, result);
}
function processFile ( file , processor , buildManager ) { let { compileContext , logger } = buildManager ; let { handler , options : opts , rext } = processor ; logger . debug ( ` ${ file . path } ${ processor . name } ` , opts ) ; let result = handler ( file , Object . assign ( { config : opts } , compileContext ) ) ; if ( ! result ) { return ; } rext && ( file . rext = rext ) ; if ( isPromise ( result ) ) { buildManager . addAsyncTask ( file , result ) ; return ; } if ( result . isSfcComponent ) { compileComponent ( result , file , buildManager ) ; result = { content : file . content } ; } buildManager . updateFileCompileResult ( file , result ) ; }
Process file using the given processor

@inner
@param {Object} file the file to process
@param {Object} processor the processor to use
@param {BuildManager} buildManager the build manager
Process file using the given processor