vue-cli3.0 configuration picture of base64 transfer rules

vue-cli3.0 found packed time, some of the less than 10k of pictures did not turn base64, needs its own new vue.config.js a file (in the root directory), and then perform the following configuration, you can control the picture escaping rules

module.exports = {
  chainWebpack: config => {
    config.module
      .rule('images')
      .use('url-loader')
      .loader('url-loader')
      .tap(options => Object.assign(options, { limit: 20000 }))
  }
}

 

Guess you like

Origin www.cnblogs.com/gxp69/p/11938645.html