Skip to content

Commit

Permalink
Import svg as file instead of esModule (#90)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien LeBlanc <sebastien.leblanc@libeo.com>
  • Loading branch information
mrleblanc101 and Sébastien LeBlanc authored Jun 30, 2022
1 parent a327964 commit 7e3a18d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/module.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const logger = require('consola').withScope('nuxt-svg-loader')

export default function nuxtSvgLoader() {
const { svgLoader: options } = this.options
export default function nuxtSvgLoader(moduleOptions) {
const options = Object.assign({}, this.options.svgLoader, moduleOptions)

if (options && options.svgo && !options.svgoConfig) {
options.svgoConfig = options.svgo
Expand Down Expand Up @@ -33,10 +33,13 @@ const setupVueSvgLoader = (options, fileName) => (config) => {
oneOf: [
{
resourceQuery: /inline/,
loader: 'file-loader',
query: {
name: fileName
}
use: {
loader: "file-loader",
options: {
esModule: false,
name: fileName
},
},
},
{
use: [
Expand Down

0 comments on commit 7e3a18d

Please sign in to comment.