Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Load Order different in Dev vs Prod #45

Open
muditjaju opened this issue Apr 19, 2020 · 4 comments
Open

CSS Load Order different in Dev vs Prod #45

muditjaju opened this issue Apr 19, 2020 · 4 comments

Comments

@muditjaju
Copy link

muditjaju commented Apr 19, 2020

I have the following import statements in my client.js file -

import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
import "../node_modules/slick-carousel/slick/slick.css";
import "../node_modules/slick-carousel/slick/slick-theme.css";
import "../node_modules/font-awesome/css/font-awesome.min.css";
import "./resources/css/global.css";

In the development mode my global.css styles have higher preference than bootstrap which is as expected. But in Production the order of the CSS files loading changes with my custom css (global.css) loading before Bootstrap leading to an undesired situation.

I am using [email protected]

@vaibhav-systango
Copy link

Also @tirthbodawala @ankushtiwari-atyantik The dynamic css chunks generated via webpack doesn't loads on Firefox only the static css that's pre injected via server.js works

@tirthbodawala
Copy link
Member

tirthbodawala commented May 1, 2020 via email

@vaibhav-systango
Copy link

@tirthbodawala @ankushtiwari-atyantik
So this is how my style import looks like which works fine on chrome, this is generated by default in the build
<link rel="preload" href="/css/05c4bf064c71d806ba51.css" as="style" onload="this.rel='stylesheet'">

Now when I refactor it to following in browser it starts working fine on firefox, as I think firefox doesn;t supports preload, so you have any solution to fix this ?
<link rel="stylesheet" href="/css/05c4bf064c71d806ba51.css" >

@vaibhav-systango
Copy link

@tirthbodawala @ankushtiwari-atyantik any help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants