Closed darul75 closed 8 years ago
hi,
I can not figure out how to use decorator with webpack, I mean if I want to use
@createStore @immutable class AppStore {
I put this in my webpack config
{ test: /\.js?$/, loaders: ['react-hot', 'babel?presets[]=react,presets[]=es2015,plugins[]=syntax-decorators'], exclude: /(node_modules|__tests__)/ },
But webpack is not aware of annotation I guess and decorator not interpreted, so I came to old way of doing
// no matter if makeHot not used but only createStore decorator let appStore = makeHot(alt, immutable(class AppStore { constructor() {
thx
Jul
Babel 6 doesn't support decorators yet: https://phabricator.babeljs.io/T2645
You can try the legacy transform plugin if you want: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.
hi,
I can not figure out how to use decorator with webpack, I mean if I want to use
I put this in my webpack config
But webpack is not aware of annotation I guess and decorator not interpreted, so I came to old way of doing
thx
Jul