Recently I discovered Flux architecture and found this, React starter kit. Good structure, but, the application need to be compiled for browsers, from node.js with gulp.
I'm using reqwest for making ajax calls to server, reqwest need window , which on node.js isn't available. When I compile (using gulp-render) from ES 6 to ES 5.1, react render evaluate all require(..) files and give me error because window is not defined, how could I avoid this? Have you had to deal with something like this?
events.js:72
throw er; // Unhandled 'error' event
^
ReferenceError: window is not defined
at E:\projects\micaimportanta\node_modules\reqwest\reqwest.js:13:13
at win (E:\projects\micaimportanta\node_modules\reqwest\reqwest.js:8:72)
at Object.<anonymous> (E:\projects\micaimportanta\node_modules\reqwest\reqwest.js:11:2)
at Module._compile (module.js:456:26)
at Module._extensions..js (module.js:474:10)
at reactTransform (E:\projects\micaimportanta\gulpfile.js:65:5)
at Object.Plugin.reactTransform (E:\projects\micaimportanta\node_modules\gulp-render\index.js:72:7)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)