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) {
6464 } , defaultCompileOptions ) )
6565 var code
6666 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+ )
7171 code = 'module.exports={render:function(){},staticRenderFns:[]}'
7272 } else {
7373 var bubleOptions = vueOptions . buble
@@ -104,3 +104,7 @@ function toFunction (code) {
104104 indent_size : 2 // eslint-disable-line camelcase
105105 } ) + '}'
106106}
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