nunjucks-loader
nunjucks-loader copied to clipboard
Inline svg loader returns [object Object]
Hello @at0g,
I've been trying to use your loader for a project I'm working on. We are using nunjucks as the render engine combining it with Storybook to visualize the components in a nice way.
And we are having some issues with the SVG, I saw in previous issues that you suggested using the following to render SVG's but I always get [object Object]
instead of the actual SVG inline.
{{ 'svg-loader!./svg_to_render.svg' | require }}
Version used:
"nunjucks-loader": "^3.0.0"
- Do you have any idea why this is happening?
Thank you so much for the nice loader and keep up with the good work 👏
Because svg-loader
returns JSON object, i guess?
If you want to render inline SVG, use raw-loader
, see example in readme https://github.com/at0g/nunjucks-loader#filters-and-extensions