File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ module.exports = function (html) {
64
64
} , defaultCompileOptions ) )
65
65
var code
66
66
if ( compiled . errors . length ) {
67
- var self = this
68
- compiled . errors . forEach ( function ( err ) {
69
- self . emitError ( '\n Vue template syntax error:\n\n ' + err + '\n' )
70
- } )
67
+ this . emitError (
68
+ `\n Error compiling template:\n ${ pad ( html ) } \n` +
69
+ compiled . errors . map ( e => ` - ${ e } ` ) . join ( '\n' ) + '\n'
70
+ )
71
71
code = 'module.exports={render:function(){},staticRenderFns:[]}'
72
72
} else {
73
73
var bubleOptions = vueOptions . buble
@@ -104,3 +104,7 @@ function toFunction (code) {
104
104
indent_size : 2 // eslint-disable-line camelcase
105
105
} ) + '}'
106
106
}
107
+
108
+ function pad ( html ) {
109
+ return html . split ( / \r ? \n / ) . map ( line => ` ${ line } ` ) . join ( '\n' )
110
+ }
You can’t perform that action at this time.
0 commit comments