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
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -476,8 +476,7 @@ module.exports = {
476
476
477
477
### Plugins
478
478
479
-
In order to use [plugins](http://lesscss.org/usage/#plugins), simply set the
480
-
`plugins` option like this:
479
+
In order to use [plugins](http://lesscss.org/usage/#plugins), simply set the `plugins` option like this:
481
480
482
481
```js
483
482
// webpack.config.js
@@ -499,6 +498,20 @@ module.exports = {
499
498
};
500
499
```
501
500
501
+
> ℹ️ Access to the [loader context](https://webpack.js.org/api/loaders/#the-loader-context) inside the custom plugin can be done using the `less.webpackLoaderContext` property.
// Loader context is available in `less.webpackLoaderContext`
508
+
509
+
returnMath.PI;
510
+
});
511
+
},
512
+
};
513
+
```
514
+
502
515
### Extracting style sheets
503
516
504
517
Bundling CSS with webpack has some nice advantages like referencing images and fonts with hashed urls or [hot module replacement](https://webpack.js.org/concepts/hot-module-replacement/) in development. In production, on the other hand, it's not a good idea to apply your style sheets depending on JS execution. Rendering may be delayed or even a [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content) might be visible. Thus it's often still better to have them as separate files in your final production build.
0 commit comments