Skip to content

Commit 9907f13

Browse files
refactor: readme
1 parent 1cb903b commit 9907f13

File tree

1 file changed

+2
-53
lines changed

1 file changed

+2
-53
lines changed

README.md

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ It's useful when you, for instance, need to post process the CSS as a string.
9494

9595
|Name|Type|Default|Description|
9696
|:--:|:--:|:-----:|:----------|
97-
|**[`root`](#root)**|`{String}`|`/`|Path to resolve URLs, URLs starting with `/` will not be translated|
9897
|**[`url`](#url)**|`{Boolean}`|`true`| Enable/Disable `url()` handling|
9998
|**[`import`](#import)** |`{Boolean}`|`true`| Enable/Disable @import handling|
10099
|**[`modules`](#modules)**|`{Boolean}`|`false`|Enable/Disable CSS Modules|
@@ -103,27 +102,6 @@ It's useful when you, for instance, need to post process the CSS as a string.
103102
|**[`camelCase`](#camelcase)**|`{Boolean\|String}`|`false`|Export Classnames in CamelCase|
104103
|**[`importLoaders`](#importloaders)**|`{Number}`|`0`|Number of loaders applied before CSS loader|
105104

106-
### `root`
107-
108-
For URLs that start with a `/`, the default behavior is to not translate them.
109-
110-
`url(/image.png) => url(/image.png)`
111-
112-
If a `root` query parameter is set, however, it will be prepended to the URL
113-
and then translated.
114-
115-
**webpack.config.js**
116-
```js
117-
{
118-
loader: 'css-loader',
119-
options: { root: '.' }
120-
}
121-
```
122-
123-
`url(/image.png)` => `require('./image.png')`
124-
125-
Using 'Root-relative' urls is not recommended. You should only use it for legacy CSS files.
126-
127105
### `url`
128106

129107
To disable `url()` resolving by `css-loader` set the option to `false`.
@@ -400,37 +378,8 @@ module.exports = {
400378

401379
### Extract
402380

403-
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.
404-
405-
**webpack.config.js**
406-
```js
407-
const env = process.env.NODE_ENV
408-
409-
const ExtractTextPlugin = require('extract-text-webpack-plugin')
410-
411-
module.exports = {
412-
module: {
413-
rules: [
414-
{
415-
test: /\.css$/,
416-
use: env === 'production'
417-
? ExtractTextPlugin.extract({
418-
fallback: 'style-loader',
419-
use: [ 'css-loader' ]
420-
})
421-
: [ 'style-loader', 'css-loader' ]
422-
},
423-
]
424-
},
425-
plugins: env === 'production'
426-
? [
427-
new ExtractTextPlugin({
428-
filename: '[name].css'
429-
})
430-
]
431-
: []
432-
}
433-
```
381+
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.
434383

435384
<h2 align="center">Maintainers</h2>
436385

0 commit comments

Comments
 (0)