I'm using babelify version 6.3.0 set to stage 0. ES6 / ES7 are working great. However when I try to use Javascript's proxy functionality:
set product(product={}) {
this._product = new Proxy({}, {})
}
I get:
ReferenceError: Can't find variable: Proxy
Any ideas?
From the Babel website:
You cannot proxy a full object with all the traps but you can create proxied properties for get and set at least.
You can even wrap it around a method
And then:
Babel translates ES6/ES7 code (assuming you've connected the appropriate presets) into valid ES5 code.
I'm afraid that there's no way to express ES6 proxies via ES5 syntax.
You can see that proxies don't nave any equivalent on es6-features site. There's also a warning about it in the bottom of 'proxies' section of Babel docs.