-
-
Notifications
You must be signed in to change notification settings - Fork 384
Support insertInto option similar to style-loader? #370
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
Comments
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
Yep, we can implement this 👍 so it is feature |
@brophdawg11 would the style need to be injected in the right order as well? so |
A functionality like the I have the use-case that I have a large header (different device- and SEO-specific meta tags which are less important than the CSS references). Using
that would be easily possible. To achive the usecase of @brophdawg11, what about:
? I think |
Hey, thank you for the awesome plugin! |
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
Sorry for the delay - I just updated the PR (#371) with the new approach suggested by @evilebottnawi |
Is there a chance to get an option, to insert the |
Would this package be open to adding support for an
insertInto
option similar to whatstyle-loader
supports, which allows clients to specify a selector for the DOM node into which they wantlink
tags inserted inside of? By default, it would be thehead
.We have a scenario where some orchestrated content being injected into an existing app inside of
<body>
and that content contains it's mainapp.css
file. However, any async-loaded CSS files break the expected cascade because they go into<head>
. So basically, we end up with a DOM such as:When the normal order should be
app.css
->async.css
.I'm planning to get a PR together, but the solution is fairly straightforward it seems. I've modified
mainTemplate.hooks.requireEnsure.tap
locally to essentially generate JS code that does the following, and it seems to work without issue:The text was updated successfully, but these errors were encountered: