blob: aec4fb534ed543c2328987a432cff7bf01c38e3e [file] [log] [blame]
import {
logWarn
} from './util'
import {
parseTemplate
} from './parser'
module.exports = function (source) {
this.cacheable && this.cacheable()
const callback = this.async()
parseTemplate(source)
.then(({ parsed, log }) => {
if (log && log.length) {
logWarn(this, log)
}
callback(null, parsed)
}).catch(e => {
callback(e, '')
})
}