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
loader:'style-loader', // creates style nodes from JS strings
329
+
loader:"style-loader", // creates style nodes from JS strings
294
330
},
295
331
{
296
-
loader:'css-loader', // translates CSS into CommonJS
332
+
loader:"css-loader", // translates CSS into CommonJS
297
333
},
298
334
{
299
-
loader:'less-loader', // compiles Less to CSS
335
+
loader:"less-loader", // compiles Less to CSS
300
336
},
301
337
],
302
338
},
@@ -315,21 +351,21 @@ To enable sourcemaps for CSS, you'll need to pass the `sourceMap` property in th
315
351
316
352
```javascript
317
353
module.exports= {
318
-
devtool:'source-map', // any "source-map"-like devtool is possible
354
+
devtool:"source-map", // any "source-map"-like devtool is possible
319
355
module: {
320
356
rules: [
321
357
{
322
358
test:/\.less$/,
323
359
use: [
324
-
'style-loader',
360
+
"style-loader",
325
361
{
326
-
loader:'css-loader',
362
+
loader:"css-loader",
327
363
options: {
328
364
sourceMap:true,
329
365
},
330
366
},
331
367
{
332
-
loader:'less-loader',
368
+
loader:"less-loader",
333
369
options: {
334
370
sourceMap:true,
335
371
},
@@ -356,7 +392,7 @@ Starting with `less-loader` 4, you can now choose between Less' builtin resolver
356
392
webpack provides an [advanced mechanism to resolve files](/configuration/resolve/). The `less-loader` applies a Less plugin that passes all queries to the webpack resolver. Thus you can import your Less modules from `node_modules`. Just prepend them with a `~` which tells webpack to look up the [`modules`](/configuration/resolve/#resolvemodules).
357
393
358
394
```css
359
-
@import'~bootstrap/less/bootstrap';
395
+
@import"~bootstrap/less/bootstrap";
360
396
```
361
397
362
398
It's important to only prepend it with `~`, because `~/` resolves to the home-directory. webpack needs to distinguish between `bootstrap` and `~bootstrap`, because CSS and Less files have no special syntax for importing relative files. Writing `@import "file"` is the same as `@import "./file";`
0 commit comments