packages/okam-build/lib/processor/helper/component.js
function getCompOriginFileInfoByType(type, filePathNoExtname, options) {

    const componentExtMap = COMPONENT_FILE_EXT_NAMES[type] || {};

    // handle native file
    let componentType;
    let missingMustFileExtnames = [];
    let fileExtnameMap = {};

    Object.keys(componentExtMap.originFiles || {}).forEach(k => {
        let filePath = `${filePathNoExtname}.${k}`;
        if (!isCompFileExists(filePath, options.compileContext)) {
            return;
        }

        let flagKey = componentExtMap.originFiles[k];
        if (typeof flagKey === 'string') {
            // add flag for native component script
            componentType = flagKey;
        }

        fileExtnameMap[k] = filePath;
    });

    (componentExtMap.mustFile || []).forEach(fileExt => {
        if (!fileExtnameMap.hasOwnProperty(fileExt)) {
            missingMustFileExtnames.push(fileExt);
        }
    });

    return {
        componentType,
        missingMustFileExtnames,
        fileExtnameMap
    };
}
function getCompOriginFileInfoByType(type, filePathNoExtname, options) {

    const componentExtMap = COMPONENT_FILE_EXT_NAMES[type] || {};

    // handle native file
    let componentType;
    let missingMustFileExtnames = [];
    let fileExtnameMap = {};

    Object.keys(componentExtMap.originFiles || {}).forEach(k => {
        let filePath = `${filePathNoExtname}.${k}`;
        if (!isCompFileExists(filePath, options.compileContext)) {
            return;
        }

        let flagKey = componentExtMap.originFiles[k];
        if (typeof flagKey === 'string') {
            // add flag for native component script
            componentType = flagKey;
        }

        fileExtnameMap[k] = filePath;
    });

    (componentExtMap.mustFile || []).forEach(fileExt => {
        if (!fileExtnameMap.hasOwnProperty(fileExt)) {
            missingMustFileExtnames.push(fileExt);
        }
    });

    return {
        componentType,
        missingMustFileExtnames,
        fileExtnameMap
    };
}
获取原生(页面、自定义)组件的相关文件信息内容

@param {string} type  COMPONENT_FILE_EXT_NAMES key
@param {string} filePathNoExtname 无后缀名的文件路径
@param {Object} options options
@return {Object}
{
component 类型
componentType,
// 对应原生缺失的必要文件的后缀名
missingMustFileExtnames,
// 后缀名: 文件完整路径 {extname: fullPath}
fileExtnameMap
}