import { loader } from 'webpack' ; import { uniq , map , kebabCase } from 'lodash' ; import { PluginOptions } from '../types' ; import parseSfc from './parseSfc' ; import compileTemplateFromDescriptor from './compileTemplateFromDescriptor' ; export default function extractTagsFromSfc ( this , options ) { const sfcDescriptor = parseSfc . call ( this , options . compiler ) ; const compiled = compileTemplateFromDescriptor . call ( this , sfcDescriptor , options . compiler ) ; if ( compiled && compiled . tags ) { return uniq ( map ( compiled . tags , tag => kebabCase ( tag ) ) ) ; } return false ; }