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
327
+
loader:"style-loader", // creates style nodes from JS strings
292
328
},
293
329
{
294
-
loader:'css-loader', // translates CSS into CommonJS
330
+
loader:"css-loader", // translates CSS into CommonJS
295
331
},
296
332
{
297
-
loader:'less-loader', // compiles Less to CSS
333
+
loader:"less-loader", // compiles Less to CSS
298
334
},
299
335
],
300
336
},
@@ -313,21 +349,21 @@ To enable sourcemaps for CSS, you'll need to pass the `sourceMap` property in th
313
349
314
350
```javascript
315
351
module.exports= {
316
-
devtool:'source-map', // any "source-map"-like devtool is possible
352
+
devtool:"source-map", // any "source-map"-like devtool is possible
317
353
module: {
318
354
rules: [
319
355
{
320
356
test:/\.less$/,
321
357
use: [
322
-
'style-loader',
358
+
"style-loader",
323
359
{
324
-
loader:'css-loader',
360
+
loader:"css-loader",
325
361
options: {
326
362
sourceMap:true,
327
363
},
328
364
},
329
365
{
330
-
loader:'less-loader',
366
+
loader:"less-loader",
331
367
options: {
332
368
sourceMap:true,
333
369
},
@@ -354,7 +390,7 @@ Starting with `less-loader` 4, you can now choose between Less' builtin resolver
354
390
webpack provides an [advanced mechanism to resolve files](https://webpack.js.org/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`](https://webpack.js.org/configuration/resolve/#resolve-modules).
355
391
356
392
```css
357
-
@import'~bootstrap/less/bootstrap';
393
+
@import"~bootstrap/less/bootstrap";
358
394
```
359
395
360
396
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