You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**`convertToAbsoluteUrls`**|`{Boolean}`|`false`|Converts relative URLs to absolute urls, when source maps are enabled|
@@ -285,6 +285,20 @@ By default, the style-loader appends `<style>` elements to the end of the style
285
285
}
286
286
```
287
287
288
+
A new `<style>` element can be inserted before a specific element by passing an object, e.g.
289
+
290
+
**webpack.config.js**
291
+
```js
292
+
{
293
+
loader:'style-loader'
294
+
options: {
295
+
insertAt: {
296
+
before:'#id'
297
+
}
298
+
}
299
+
}
300
+
```
301
+
288
302
### `insertInto`
289
303
By default, the style-loader inserts the `<style>` elements into the `<head>` tag of the page. If you want the tags to be inserted somewhere else you can specify a CSS selector for that element here. If you target an [IFrame](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement) make sure you have sufficient access rights, the styles will be injected into the content document head.
290
304
You can also insert the styles into a [ShadowRoot](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot), e.g
thrownewError("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
177
+
thrownewError("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
0 commit comments