I am trying to conditionally require css for my react project and it works locally. However, when the react-scripts build command is executed by react js all css files get bundled into one and the conditional import no longer works.
if(isSmartPhoneOrTablet()){
require("./mobileStyle.css");
}else {
require("./style.css");
}
"build": "react-scripts build"