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: src/content/loaders/css-loader.mdx
+3-24Lines changed: 3 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,29 +89,7 @@ console.log(css); // {String}
89
89
90
90
If there are SourceMaps, they will also be included in the result string.
91
91
92
-
If, for one reason or another, you need to extract CSS as a
93
-
plain string resource (i.e. not wrapped in a JS module) you
94
-
might want to check out the [extract-loader](https://github.com/peerigon/extract-loader).
95
-
It's useful when you, for instance, need to post process the CSS as a string.
96
-
97
-
**webpack.config.js**
98
-
99
-
```js
100
-
module.exports= {
101
-
module: {
102
-
rules: [
103
-
{
104
-
test:/\.css$/i,
105
-
use: [
106
-
"handlebars-loader", // handlebars loader expects raw resource string
107
-
"extract-loader",
108
-
"css-loader",
109
-
],
110
-
},
111
-
],
112
-
},
113
-
};
114
-
```
92
+
If, for one reason or another, you need to extract CSS as a file (i.e. do not store CSS in a JS module) you might want to check out the [recommend example](https://github.com/webpack-contrib/css-loader#recommend).
115
93
116
94
## Options
117
95
@@ -752,9 +730,10 @@ For more information on options see:
752
730
Supported template strings:
753
731
754
732
-`[name]` the basename of the resource
733
+
-`[folder]` the folder the resource relative to the `compiler.context` option or `modules.localIdentContext` option.
755
734
-`[path]` the path of the resource relative to the `compiler.context` option or `modules.localIdentContext` option.
756
735
-`[file]` - filename and path.
757
-
-`[ext]` - extension with leading .
736
+
-`[ext]` - extension with leading `.`.
758
737
-`[hash]` - the hash of the string, generated based on `localIdentHashSalt`, `localIdentHashFunction`, `localIdentHashDigest`, `localIdentHashDigestLength`, `localIdentContext`, `resourcePath` and `exportName`
759
738
-`[<hashFunction>:hash:<hashDigest>:<hashDigestLength>]` - hash with hash settings.
0 commit comments