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
+69-1Lines changed: 69 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,6 @@ module.exports = {
77
77
options: {
78
78
lessOptions: {
79
79
strictMath:true,
80
-
noIeCompat:true,
81
80
},
82
81
},
83
82
},
@@ -197,6 +196,75 @@ module.exports = {
197
196
};
198
197
```
199
198
199
+
### `appendData`
200
+
201
+
Type: `String|Function`
202
+
Default: `undefined`
203
+
204
+
AppendData `Less` code after the actual entry file.
205
+
206
+
This can be useful when you need to rewrite some of your Less variables.:
207
+
208
+
> ℹ 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.
209
+
210
+
#### `String`
211
+
212
+
```js
213
+
module.exports= {
214
+
module: {
215
+
rules: [
216
+
{
217
+
test:/\.less$/,
218
+
use: [
219
+
'style-loader',
220
+
'css-loader',
221
+
{
222
+
loader:'less-loader',
223
+
options: {
224
+
appendData:`@env: ${process.env.NODE_ENV};`,
225
+
},
226
+
},
227
+
],
228
+
},
229
+
],
230
+
},
231
+
};
232
+
```
233
+
234
+
#### `Function`
235
+
236
+
```js
237
+
module.exports= {
238
+
module: {
239
+
rules: [
240
+
{
241
+
test:/\.less$/,
242
+
use: [
243
+
'style-loader',
244
+
'css-loader',
245
+
{
246
+
loader:'less-loader',
247
+
options: {
248
+
appendData: (loaderContext) => {
249
+
// More information about available properties https://webpack.js.org/api/loaders/
0 commit comments