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
{{ message }}
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
Repository navigation
Commit 3d53968
Browse filesBrowse the repository at this point in the historyBrowse files
Rewrite your urls with alias, this is useful when it's hard to change url paths of your input files, for example, when you're using some css / sass files in another package (bootstrap, ratchet, font-awesome, etc.).
143
-
144
-
`css-loader`'s `alias` follows the same syntax as webpack's `resolve.alias`, you can see the details at the [resolve docs](https://webpack.js.org/configuration/resolve/#resolve-alias)
Check out this [working bootstrap example](https://github.com/bbtfr/webpack2-bootstrap-sass-sample).
181
-
182
116
### `import`
183
117
184
118
To disable `@import` resolving by `css-loader` set the option to `false`
@@ -342,24 +276,6 @@ You can also specify the absolute path to your custom `getLocalIdent` function t
342
276
343
277
> ℹ️ For prerendering with extract-text-webpack-plugin you should use `css-loader/locals` instead of `style-loader!css-loader`**in the prerendering bundle**. It doesn't embed CSS but only exports the identifier mappings.
344
278
345
-
### `minimize`
346
-
347
-
By default the css-loader minimizes the css if specified by the module system.
348
-
349
-
In some cases the minification is destructive to the css, so you can provide your own options to the cssnano-based minifier if needed. See [cssnano's documentation](http://cssnano.co/guides/) for more information on the available options.
350
-
351
-
You can also disable or enforce minification with the `minimize` query parameter.
352
-
353
-
**webpack.config.js**
354
-
```js
355
-
{
356
-
loader:'css-loader',
357
-
options: {
358
-
minimize:true|| {/* CSSNano Options */}
359
-
}
360
-
}
361
-
```
362
-
363
279
### `sourceMap`
364
280
365
281
To include source maps set the `sourceMap` option.
@@ -462,37 +378,8 @@ module.exports = {
462
378
463
379
### Extract
464
380
465
-
For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on. This can be achieved by using the [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) to extract the CSS when running in production mode.
For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
382
+
This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract the CSS when running in production mode.
0 commit comments