svg-sprite-loader: Import of SVG-file fails with extraction (returns undefined)
With my current build-process, the import of an SVG-file returns undefined when extraction is turned on. with { extract: off } it returns an object as expected per documentation.
I have created a reduced test-case, which I will hope assist the debugging process.
Details of my setup:
- Windows 10
- Node v. 7.2.1 See package.json for further details.
To Reproduce:
- Download the test-case and install dependencies.
- Start up the project with
npm start. This should launch your web-browser athttp://localhost:3000. - Open the console, and see that
undefinedis logged byShell.vue:12, which attempts to log theimportof./assets/arrow.svg. - In
build/webpack.base.conf.js:59, setextract: trueand run the build process again.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (15 by maintainers)
Commits related to this issue
- fix(plugin): properly generate symbol url in extract mode reported in #106 — committed to JetBrains/svg-sprite-loader by kisenka 7 years ago
- fix(plugin): properly replace paths on Windows Fixes #106 — committed to JetBrains/svg-sprite-loader by kisenka 7 years ago
Got it, it’s Windows path resolving issue. I will have access to Windows machine tomorrow, stay tuned!
That strange. Could you push latest changes in your repo so I can check?
I think I understand what you want - svg image should goes to external sprite, but symbol (
SpriteSymbol<id: string, viewBox: string, content: string>) should returns from import statement instead of symbol url. Am I right?