Closed dsvanidze closed 4 years ago
Hello @dsvanidze.
I got your point. I seem to have broken this functionality during the last refactoring.
I propose to skip extracting and transforming at all when there is no template. It's useless to transform code without directives and components. So extractAndTransform
will come to this:
const extractAndTransform = (code, template = '') => {
if (tyepof template !== 'string' || !template.trim()) {
return code;
}
const { directives, components } = extract(template)
return transform(code, components, directives);
}
Please don't keep comments inside the code, this logic is obvious and doesn't require additional description.
Let me know if you are going to refactor your PR or I can add it myself.
Thank you very much for your contribution.
@dsvanidze
I just did it on my own. The changes will be released soon.
Thank you!
Great! I am looking forward to the release!
extended plugin for vue components with render functions, which do not use templates. This fixes the error
TypeError: Cannot read property 'trim' of undefined
.