Merge pull request #2430 from Human-Connection/load-svgs-with-babel

Use babel-loader with vue-svg-loader
This commit is contained in:
Robert Schäfer 2019-12-05 23:27:24 +01:00 committed by GitHub
commit 942e74163e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 22 deletions

View File

@ -258,6 +258,9 @@ export default {
svgRule.test = /\.(png|jpe?g|gif|webp)$/
config.module.rules.push({
test: /\.svg$/,
use: [
'babel-loader',
{
loader: 'vue-svg-loader',
options: {
svgo: {
@ -271,6 +274,8 @@ export default {
],
},
},
},
],
})
},
},

View File

@ -41,6 +41,9 @@ module.exports = async ({ config, mode }) => {
config.module.rules.push({
test: /\.svg$/,
use: [
'babel-loader',
{
loader: 'vue-svg-loader',
options: {
svgo: {
@ -54,6 +57,8 @@ module.exports = async ({ config, mode }) => {
],
},
},
},
],
})
config.resolve.alias = {