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
Copy file name to clipboardExpand all lines: README.md
-19
Original file line number
Diff line number
Diff line change
@@ -82,8 +82,6 @@ import url from 'file.css';
82
82
<linkrel="stylesheet"href="path/to/file.css" />
83
83
```
84
84
85
-
> ℹ️ Source maps and assets referenced with `url`: when style loader is used with `{ options: { sourceMap: true } }` option, the CSS modules will be generated as `Blob`s, so relative paths don't work (they would be relative to `chrome:blob` or `chrome:devtools`). In order for assets to maintain correct paths setting `output.publicPath` property of webpack configuration must be set, so that absolute paths are generated. Alternatively you can enable the `convertToAbsoluteUrls` option mentioned above.
86
-
87
85
### `Useable`
88
86
89
87
The `style-loader` injects the styles lazily making them useable on-demand via `style.use()` / `style.unuse()`
@@ -145,7 +143,6 @@ Styles are not added on `import/require()`, but instead on call to `use`/`ref`.
145
143
|**`insertInto`**|`{String\|Function}`|`<head>`| Inserts `<style></style>` into the given position |
146
144
|**`singleton`**|`{Boolean}`|`undefined`| Reuses a single `<style></style>` element, instead of adding/removing individual elements for each required module. |
If convertToAbsoluteUrls and sourceMaps are both enabled, relative urls will be converted to absolute urls right before the css is injected into the page. This resolves [an issue](https://github.com/webpack/style-loader/pull/96) where relative resources fail to load when source maps are enabled. You can enable it with the convertToAbsoluteUrls option.