dschewchenko / nuxt-svgicon Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi! Can you please add instructions on how to use? Tried to figured it out on my own but I'm a nuxt novice and couldn't do it.. Will help with testing!
Thanks for your work!
When I run dev server the index.js
was import wrong files so I get error file not found.
My nuxt config:
[
'nuxt-svgicon', {
tagName: 'svg-icon',
sourcePath: 'svg-icons',
targetPath: 'components/compiled-icons',
}
]
I put all svg icons in svg-icons folder
The generated files in components/compiled-icons folder:
The components/compiled-icons/index.js
file:
/* eslint-disable */
import './chevron-up-circle.js'
import './new-solid.js'
import './plus-circle.js'
Please help me :(
With default config the package generate as below image so I get error cause missing imported files. Please help me :(
I try to use the config below but no icon appear on browser.
[
'nuxt-svgicon',
{
tagName: 'svg-icon', // usage: <svg-icon name="icon-name"></svg-icon>
sourcePath: './assets/svg',
targetPath: './assets/svg/bundle',
subDir: './assets/svg',
}
],
e.g svg\bundle\assets\svg\assets\svg\assets\svg\assets\svg\assets\svg...... Infinite loop.
After following the install instructions:
{
modules: [
'nuxt-svgicon'
]
}
Throws a few errors: first in the terminal, after running npm run dev
wile compiling, it prints:
Generated assets\svg\assets\assets\assets\assets\assets\<< this "\assets\" part of the path repeats a few hundreds if not thousands of times, didn't want to paste it here for sanity's sake>>\assets\assets\assets\\index.js
Pretty sure that's not normal, looks like a recursive issue. Then the build fails with:
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225725
npm ERR! [email protected] dev: `nuxt`
npm ERR! Exit status 3221225725
I've attached the error log if you need to take a look.
2018-11-18T19_57_15_035Z-debug.log
It does seem to generate the correct files and structure. For an svg file: assets/svs/cabin.svg
it creates:
assets
├ cabin.svg
└ bundle
├ svg
| └ cabin.js
└ index.js
Using latest version of nuxt 2 with node v 10.13.0 and npm v6.4.1
Let me know if you need more info.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.