packages/okam-build/lib/processor/component/ux-parser.js
function parse(file, options) {
    let result = sfcParser(file, options);
    let fileDir = path.dirname(file.fullPath);
    let {addFile} = options;
    let importComponents = {};
    let {customBlocks} = result;
    customBlocks && customBlocks.forEach(item => {
        let {type, attrs} = item;
        if (attrs && type === 'import') {
            let {name, src} = attrs;
            importComponents[name] = src;

            src && addFile(path.join(
                fileDir, src + '.ux'
            ));
        }
    });

    file.importComponents = importComponents;
    return result;
}
function parse(file, options) {
    let result = sfcParser(file, options);
    let fileDir = path.dirname(file.fullPath);
    let {addFile} = options;
    let importComponents = {};
    let {customBlocks} = result;
    customBlocks && customBlocks.forEach(item => {
        let {type, attrs} = item;
        if (attrs && type === 'import') {
            let {name, src} = attrs;
            importComponents[name] = src;

            src && addFile(path.join(
                fileDir, src + '.ux'
            ));
        }
    });

    file.importComponents = importComponents;
    return result;
}
function parse ( file , options ) { let result = sfcParser ( file , options ) ; let fileDir = path . dirname ( file . fullPath ) ; let { addFile } = options ; let importComponents = { } ; let { customBlocks } = result ; customBlocks && customBlocks . forEach ( item => { let { type , attrs } = item ; if ( attrs && type === 'import' ) { let { name , src } = attrs ; importComponents [ name ] = src ; src && addFile ( path . join ( fileDir , src + '.ux' ) ) ; } } ) ; file . importComponents = importComponents ; return result ; }
Parse the quick app single file component.
Return the component file info:
{
tpl: Object,
script: Object,
styles: Array.<Object>,
customBlocks: Array.<Object>
}

@param {Object} file the file to process
@param {string} file.content the component file content
@param {Object=} options the parse options, optional
@return {Object}
Parse the quick app single file component . Return the component file info : { tpl : Object script : Object styles : Array . <Object > customBlocks : Array . <Object > }