-
-
Notifications
You must be signed in to change notification settings - Fork 384
Add insert before option #331
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
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is bad solution, better don't change order their, because it can break app
It's only an option, if you don't have #mini-css-before, it still works as current. In my case, in my project I use styled-components to style component and base css. But the mini-css-extract-plugin always appends base css at bottom head tag and the css of styled-components is inserted above, so the css be overwrite by styled-component are not effected |
@tamdao it is edge case and can break your app, better avoiding this and search way how better integrate |
@evilebottnawi Thanks for your help. I will research more |
@evilebottnawi since |
|
@evilebottnawi I think you're dismissing this too quickly. This would be a really helpful change for us, since we want to inject an external stylesheet after the compiled ones from the react app. Without this change, we have to do a find/replace on the entire HTML which is far from ideal. style-loader supports the option, so adding this actually makes the environment between dev and production consistent for people who are already using the option. None of those use-cases are bad practice. |
@tommaitland so we need allow to use custom |
@evilebottnawi How can I make a function here? |
This adds an new `insertInto` option that is optional and backards-compatible. Specifying a CSS selector allows the user to specify a DOM node into which the async-loaded <link> tags should be inserted. Closes webpack-contrib#370, related to webpack-contrib#328,webpack-contrib#331
This adds an new `insertInto` option that is optional and backards-compatible. Specifying a CSS selector allows the user to specify a DOM node into which the async-loaded <link> tags should be inserted. Closes webpack-contrib#370, related to webpack-contrib#328,webpack-contrib#331
This adds an new `insertInto` option that is optional and backards-compatible. Specifying a CSS selector allows the user to specify a DOM node into which the async-loaded <link> tags should be inserted. Closes webpack-contrib#370, related to webpack-contrib#328,webpack-contrib#331
Close in favor #459 |
We have an ordering problem with
mini-css-extract-plugin
for production build.style-loader
and the package has an option to insert style like:mini-css-extract-plugin
and the package has no option for insert before.So I make a change in this PR. The logic here is finding the tag that has Id called
mini-css-before
and set insert before the tag.