6

I've read about isomorphic app development and I've seen to methods to handle assets loading in server-side.
One is webpack-isomorphic-tools.
The other is this "hack" where you define a plugin in webpack which sets process.env.BROWSER to true, and loads the assets according to that variable. i.e.:

if(process.env.BROWSER){
  require('./styles.scss');
}

I wanted to know, which is better and why?

Gershon Papi
  • 5,008
  • 3
  • 24
  • 50

0 Answers0