esnunes / riotjs-loader

riotjs module loader for webpack
MIT License
103 stars 41 forks source link

webpack loader not support riotjs 'no function' syntactic sugar? How to solve that. #29

Open silentzone opened 8 years ago

silentzone commented 8 years ago
<todo> 
        <p>{ value }</p>
        <p>{ getText(this.text) }</p> 
        this.on("update", function(){
            var d = new Date();
            this.value = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
        });
        this.text = "riot";
        getText(text){
            return "你好" + text;
        }
</todo>
ERROR in ./app/todo.tag
Module build failed: SyntaxError: D:/demo/riotjs/riotjs-loader/app/todo.tag: Unexpected token (10:22)

   8 |         this.text = "riot";
   9 |
> 10 |          getText(text){
     |                       ^
  11 |             return "你好" + text;
  12 |         }
  13 | });

 @ ./app/app.tag 2:0-21
webpack: bundle is now VALID.

'getText(text) ' must be this.getText = function (text) ,no more idea....

maxired commented 8 years ago

looks like you would need to use some es6 tag compilation first