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
You can pass any Less specific options to the `less-loader` through the `lessOptions` property in the [loader options](https://webpack.js.org/configuration/module/#rule-options-rule-query). See the [Less documentation](http://lesscss.org/usage/#command-line-usage-options) for all available options in dash-case. Since we're passing these options to Less programmatically, you need to pass them in camelCase here:
73
82
74
-
#### `Object`
83
+
#### `object`
75
84
76
85
Use an object to pass options through to Less.
77
86
@@ -105,7 +114,7 @@ module.exports = {
105
114
};
106
115
```
107
116
108
-
#### `Function`
117
+
#### `function`
109
118
110
119
Allows setting the options passed through to Less based off of the loader context.
Prepends `Less` code before the actual entry file.
169
+
Prepends/Appends`Less` code to the actual entry file.
154
170
In this case, the `less-loader` will not override the source but just **prepend** the entry's content.
155
171
156
172
This is especially useful when some of your Less variables depend on the environment:
157
173
158
-
> ℹ Since you're injecting code, this will break the source mappings in your entry file. Often there's a simpler solution than this, like multiple Less entry files.
174
+
> Since you're injecting code, this will break the source mappings in your entry file. Often there's a simpler solution than this, like multiple Less entry files.
159
175
160
-
#### `String`
176
+
#### `string`
161
177
162
178
```js
163
179
module.exports= {
@@ -181,9 +197,9 @@ module.exports = {
181
197
};
182
198
```
183
199
184
-
#### `Function`
200
+
#### `function`
185
201
186
-
##### Sync
202
+
##### `Sync`
187
203
188
204
```js
189
205
module.exports= {
@@ -217,7 +233,7 @@ module.exports = {
217
233
};
218
234
```
219
235
220
-
##### Async
236
+
##### `Async`
221
237
222
238
```js
223
239
module.exports= {
@@ -253,7 +269,12 @@ module.exports = {
253
269
254
270
### `sourceMap`
255
271
256
-
Type: `Boolean`
272
+
Type:
273
+
274
+
```ts
275
+
typesourceMap=boolean;
276
+
```
277
+
257
278
Default: depends on the `compiler.devtool` value
258
279
259
280
By default generation of source maps depends on the [`devtool`](https://webpack.js.org/configuration/devtool/) option. All values enable source map generation except `eval` and `false` value.
@@ -289,7 +310,12 @@ module.exports = {
289
310
290
311
### `webpackImporter`
291
312
292
-
Type: `Boolean`
313
+
Type:
314
+
315
+
```ts
316
+
typewebpackImporter=boolean;
317
+
```
318
+
293
319
Default: `true`
294
320
295
321
Enables/Disables the default `webpack` importer.
@@ -322,15 +348,19 @@ module.exports = {
322
348
323
349
### `implementation`
324
350
325
-
Type: `Object | String`
351
+
Type:
352
+
353
+
```ts
354
+
typeimplementation=object|string;
355
+
```
326
356
327
-
> ⚠ less-loader compatible with Less 3 and 4 versions
357
+
> less-loader compatible with Less 3 and 4 versions
328
358
329
359
The special `implementation` option determines which implementation of Less to use. Overrides the locally installed `peerDependency` version of `less`.
330
360
331
361
**This option is only really useful for downstream tooling authors to ease the Less 3-to-4 transition.**
332
362
333
-
#### `Object`
363
+
#### `object`
334
364
335
365
**webpack.config.js**
336
366
@@ -356,7 +386,7 @@ module.exports = {
356
386
};
357
387
```
358
388
359
-
#### `String`
389
+
#### `string`
360
390
361
391
**webpack.config.js**
362
392
@@ -585,7 +615,7 @@ Bundling CSS with webpack has some nice advantages like referencing images and f
585
615
There are two possibilities to extract a style sheet from the bundle:
586
616
587
617
-[`extract-loader`](https://github.com/peerigon/extract-loader) (simpler, but specialized on the css-loader's output)
588
-
-[MiniCssExtractPlugin](https://github.com/webpack-contrib/mini-css-extract-plugin) (more complex, but works in all use-cases)
618
+
-[`MiniCssExtractPlugin`](https://github.com/webpack-contrib/mini-css-extract-plugin) (more complex, but works in all use-cases)
0 commit comments