I have a Node application that specifies babel with conversion options and registers in the main file, for example:
require('babel').transform('code', { stage: 1 });
require('babel/register')({ ignore: false });
require('../src/index');
Which is great work allowing me to use ES6 in ../src/indexand all subsequent files, but it doesn't seem to allow me to use Decorators, as it should be, declaring a level 1 conversion. I get a syntax error instead. Why does this not support the decorator? The actual decorator I'm trying to use is:
@test1
test Class() {
constructor() {
this.test = 'test';
}
}
function test1(obj) {
obj.test1 = 'test1';
}
source
share