nl_tokens: Parse the single file component . Return the component file info : { tpl : Object script : Object styles : Array . <Object > customBlocks : Array }
pl_tokens: function parse ( file , options ) { let { root , config } = options ; let parseOpts = Object . assign ( { } , { pad : 'line' } , config && config . parse ) ; let result = compiler . parseComponent ( file . content . toString ( ) , parseOpts ) ; let { customBlocks } = result ; let { fullPath : filePath } = file ; let tplFile = createPartFile ( file , result . template , { isTemplate : true , root , filePath } ) ; let scriptFile = createPartFile ( file , result . script , { isScript : true , root , filePath } ) ; let styleFiles = result . styles . map ( ( item , index ) => createPartFile ( file , item , { isStyle : true , index , root , filePath } ) ) ; // fix pad line missing when lang is set in script part if ( scriptFile && parseOpts . pad === 'line' ) { let content = scriptFile . content . toString ( ) ; scriptFile . content = content . replace ( / ^\n+ / , match => match . <mask> ( / \n / g , '//\n' ) ) ; } if ( config && config . trim ) { let content = scriptFile . content . toString ( ) ; scriptFile . content = content . trim ( ) ; } return { isSfcComponent : true , customBlocks , tpl : tplFile , script : scriptFile , styles : styleFiles } ; }