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
+24-21
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ npm i -D postcss-loader
33
33
34
34
### `Configuration`
35
35
36
-
**postcss.config.js**
36
+
**`postcss.config.js`**
37
37
```js
38
38
module.exports= {
39
39
parser:'sugarss',
@@ -72,7 +72,7 @@ Config lookup starts from `path.dirname(file)` and walks the file tree upwards u
72
72
73
73
After setting up your `postcss.config.js`, add `postcss-loader` to your `webpack.config.js`. You can use it standalone or in conjunction with `css-loader` (recommended). Use it **after**`css-loader` and `style-loader`, but **before** other preprocessor loaders like e.g `sass|less|stylus-loader`, if you use any.
74
74
75
-
**webpack.config.js**
75
+
**`webpack.config.js`**
76
76
```js
77
77
module.exports= {
78
78
module: {
@@ -88,7 +88,7 @@ module.exports = {
88
88
89
89
> ⚠️ When `postcss-loader` is used standalone (without `css-loader`) don't use `@import` in your CSS, since this can lead to quite bloated bundles
90
90
91
-
**webpack.config.js (recommended)**
91
+
**`webpack.config.js` (recommended)**
92
92
```js
93
93
module.exports= {
94
94
module: {
@@ -122,6 +122,7 @@ module.exports = {
122
122
123
123
If you use JS styles without the [`postcss-js`][postcss-js] parser, add the `exec` option.
124
124
125
+
**`webpack.config.js`**
125
126
```js
126
127
{
127
128
test:/\.style.js$/,
@@ -148,7 +149,7 @@ You can manually specify the path to search for your config (`postcss.config.js`
148
149
149
150
> ⚠️ Note that you **can't** use a **filename** other than the [supported config formats] (e.g `.postcssrc.js`, `postcss.config.js`), this option only allows you to manually specify the **directory** where config lookup should **start** from
150
151
151
-
**webpack.config.js**
152
+
**`webpack.config.js`**
152
153
```js
153
154
{
154
155
loader:'postcss-loader',
@@ -173,7 +174,7 @@ You can manually specify the path to search for your config (`postcss.config.js`
173
174
174
175
`postcss-loader` exposes context `ctx` to the config file, making your `postcss.config.js` dynamic, so can use it to do some real magic ✨
Enables source map support, `postcss-loader` will use the previous source map given by other loaders and update it accordingly, if no previous loader is applied before `postcss-loader`, the loader will generate a source map for you.
272
273
273
-
**webpack.config.js**
274
+
**`webpack.config.js`**
274
275
```js
275
276
{
276
277
test:/\.css/,
@@ -288,7 +289,7 @@ Enables source map support, `postcss-loader` will use the previous source map gi
288
289
You can set the `sourceMap: 'inline'` option to inline the source map
289
290
within the CSS directly as an annotation comment.
290
291
291
-
**webpack.config.js**
292
+
**`webpack.config.js`**
292
293
```js
293
294
{
294
295
loader:'postcss-loader',
@@ -308,7 +309,7 @@ within the CSS directly as an annotation comment.
308
309
309
310
### `Stylelint`
310
311
311
-
**webpack.config.js**
312
+
**`webpack.config.js`**
312
313
```js
313
314
{
314
315
test:/\.css$/,
@@ -330,9 +331,9 @@ within the CSS directly as an annotation comment.
330
331
}
331
332
```
332
333
333
-
### Autoprefixing
334
+
### `Autoprefixing`
334
335
335
-
**webpack.config.js**
336
+
**`webpack.config.js`**
336
337
```js
337
338
{
338
339
test:/\.css$/,
@@ -361,7 +362,7 @@ This loader [cannot be used] with [CSS Modules] out of the box due
361
362
to the way `css-loader` processes file imports. To make them work properly,
362
363
either add the css-loader’s [`importLoaders`] option.
363
364
364
-
**webpack.config.js**
365
+
**`webpack.config.js`**
365
366
```js
366
367
{
367
368
test:/\.css$/,
@@ -386,6 +387,7 @@ If you want to process styles written in JavaScript, use the [postcss-js] parser
0 commit comments