Vue Cli 3 is not allowing me to process SVG's in Webpack Vue Cli 3 is not allowing me to process SVG's in Webpack vue.js vue.js

Vue Cli 3 is not allowing me to process SVG's in Webpack


This took me a while to find a work around. Basically you need to stop file-loader matching on .svg. The best way I have found to do this is using chainWebpack and returning false from the test method on file-loader. I have included my working config.

module.exports = {  lintOnSave: false,  configureWebpack: {    module: {      rules: [        {          test: /\.(svg)(\?.*)?$/,          use: [            {              loader: 'svg-inline-loader',              options: {                limit: 10000,                name: 'assets/img/[name].[hash:7].[ext]'              }            }          ]        }      ]    }  },  chainWebpack: config => {    config.module      .rule('svg')      .test(() => false)      .use('file-loader')  }}