Skip to content

Commit

Permalink
fix: πŸ› correctly pass options to webpack loader (#32)
Browse files Browse the repository at this point in the history
* fix: πŸ› correctly pass options to webpack loader

* chore: πŸ€– changeset
  • Loading branch information
cpsoinos committed Jun 22, 2022
1 parent 73d4da8 commit 1ab6462
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-toys-behave.md
@@ -0,0 +1,5 @@
---
'nuxt-svgo': patch
---

Fix webpack loader config
13 changes: 9 additions & 4 deletions src/module.ts
Expand Up @@ -33,10 +33,15 @@ export default defineNuxtModule<ModuleOptions>({
config.module.rules.push({
test: /\.svg$/,
issuer: /\.(vue|js|ts|svg)$/,
use: ['vue-loader', 'svg-to-vue-component/loader'],
options: {
svgoConfig: config.svgo ? config.svgoConfig : config.svgo
}
use: [
'vue-loader',
{
loader: 'svg-to-vue-component/loader',
options: {
svgoConfig: options.svgo ? options.svgoConfig : options.svgo
}
}
]
})
})
}
Expand Down

0 comments on commit 1ab6462

Please sign in to comment.