docs: update docs to match image inline limit

close #2106
This commit is contained in:
Evan You
2018-08-08 09:51:16 -04:00
parent c42cb949b5
commit 70160cc268

View File

@@ -125,7 +125,22 @@ will be compiled into:
h('img', { attrs: { src: require('./image.png') }})
```
Internally, we use `file-loader` to determine the final file location with version hashes and correct public base paths, and use `url-loader` to conditionally inline assets that are smaller than 10kb, reducing the amount of HTTP requests.
Internally, we use `file-loader` to determine the final file location with version hashes and correct public base paths, and use `url-loader` to conditionally inline assets that are smaller than 4kb, reducing the amount of HTTP requests.
You can adjust the inline file size limit via [chainWebpack](../config/#chainwebpack). For example, to set the limit to 10kb instead:
``` js
// vue.config.js
module.exports = {
chainWebpack: config => {
config.module
.rule('images')
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, { limit: 10240 }))
}
}
```
### URL Transform Rules