Replies: 8 comments 1 reply
-
Any suggestions on how I can make the bundled CSS be added later in the |
Beta Was this translation helpful? Give feedback.
-
Could you give an example? |
Beta Was this translation helpful? Give feedback.
-
Sure, So my index.html looks like this before build: ...
<head>
<link rel="stylesheet" href="www.example.com/some.css" />
</head>
... And after build it looks like this: ...
<head>
<link rel="stylesheet" href="/bundle.css" />
<link rel="stylesheet" href="www.example.com/some.css" />
</head>
... But I want it to look like this: ...
<head>
<link rel="stylesheet" href="www.example.com/some.css" />
<link rel="stylesheet" href="/bundle.css" /> <!-- THIS SHOULD BE LAST, SO IT OVERWRITES OTHER RULES -->
</head>
... The main issue is that I use MaterialUI in my project and I need to have this order:
I can currently do this, but it's not what I want:
So, how can I make sure that the parcel bundle.css will be included after the other stylesheets imported in index.html? |
Beta Was this translation helpful? Give feedback.
-
@mischnic Any suggestions? 🙏 |
Beta Was this translation helpful? Give feedback.
-
So with <head>
<link rel="stylesheet" href="https://www.example.com/some.css" />
<script src="index.js"></script>
</head> body {
color: red;
} import "./index.css"; I get: <head>
<link rel="stylesheet" href="https://www.example.com/some.css" />
<link rel="stylesheet" href="/index.2c4451d2.css" />
<script src="/index.f81b525c.js"></script>
</head> |
Beta Was this translation helpful? Give feedback.
-
I found the issue! Whenever you add an inline style in the head, the CSS is imported at the top: Try this:
The output now looks like:
Any idea why simply adding a |
Beta Was this translation helpful? Give feedback.
-
Created an issue for this: #4882 |
Beta Was this translation helpful? Give feedback.
-
I am using
"parcel": "^2.0.0-nightly.318",
and the bundled CSS is imported immediately after<head>
, but I need it to be imported last so that my CSS should overwrite all other global CSS included.Was this changed recently?
Why does it import at the top of
<head>
instead of just before</head>
?Beta Was this translation helpful? Give feedback.
All reactions