Reputation: 5106
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?
Upvotes: 6
Views: 848