Skip to content

Commit 166c061

Browse files
posvaznck
authored andcommitted
🐛 Compile vue files without a template (vuejs#48)
Do not try to compile the template of a vue file if it doesn't exist. This may hapen in Vue files using pure render functions
1 parent 1b0f1ef commit 166c061

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vueTransform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function processScript (source, id, content, options, nodes) {
122122
const script = deIndent(padContent(content.slice(0, content.indexOf(source.code))) + source.code)
123123
const map = (new MagicString(script)).generateMap({ hires: true })
124124

125-
if (options.compileTemplate) {
125+
if (template && options.compileTemplate) {
126126
const render = require('vue-template-compiler').compile(template)
127127

128128
return { map, code: injectRender(script, render, lang, options) }

0 commit comments

Comments
 (0)