1
votes

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.

1
What about using environment variables for the different builds and then pulling files with specific extensions like main.android.css and main.ios.css. This is similar to how Facebook organizes the different code entry points for React Native apps.Michael Lyons
Nice suggestion, do you have any follow up on how to achieve this? I'm thinking in using style loader.Franco Risso

1 Answers

0
votes

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