Search code examples
reactjswebpackkoaes6-modules

How to serve different assets for different os


My stack is webpack, es6 modules and react for the client and koa for the server.

What I'm trying to achieve is a way to build/serve different versions of css, one for android, another for ios and another for the web.

I know I can achieve a way to put all in one css and just play with the classes according to the headers, but what I really want to do is to serve the minimum amount of css for each device.

I've some workarounds, but they all seem dirty, so let's go community, help me to solve this as elegant as possible.


Solution

  • For all those of you who get here looking for the same, I've created a small loader for webpack2 to achieve this. You can check it out here