Skip to content

Commit 7e3a18d

Browse files
mrleblanc101Sébastien LeBlanc
and
Sébastien LeBlanc
authored
Import svg as file instead of esModule (#90)
Co-authored-by: Sébastien LeBlanc <[email protected]>
1 parent a327964 commit 7e3a18d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/module.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const logger = require('consola').withScope('nuxt-svg-loader')
22

3-
export default function nuxtSvgLoader() {
4-
const { svgLoader: options } = this.options
3+
export default function nuxtSvgLoader(moduleOptions) {
4+
const options = Object.assign({}, this.options.svgLoader, moduleOptions)
55

66
if (options && options.svgo && !options.svgoConfig) {
77
options.svgoConfig = options.svgo
@@ -33,10 +33,13 @@ const setupVueSvgLoader = (options, fileName) => (config) => {
3333
oneOf: [
3434
{
3535
resourceQuery: /inline/,
36-
loader: 'file-loader',
37-
query: {
38-
name: fileName
39-
}
36+
use: {
37+
loader: "file-loader",
38+
options: {
39+
esModule: false,
40+
name: fileName
41+
},
42+
},
4043
},
4144
{
4245
use: [

0 commit comments

Comments
 (0)