-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Production build imports all icons ! #10
Comments
Got the same problem. Any news? |
No, but i switched to vue-feather-icons |
Same issue here, Any solutions yet ? I'm importing only 14 icons and |
I couldn't fix the issue and there are no words from the maintainer so I decided to move on from this project and use what @kgnfth suggested earlier ( feather icons ) but I use it's svg sprite version which adds a ~60KB to your page and you can use any icons you need. I really had enough of importing each icons individually 😅 |
What I did to import them separately was to create a nodejs script where I created an array with the list of all the icons. And based on that list, generate all node script const fs = require('fs');
const icons = ['PhX', 'PhUser']
const content = ''
const iconComponentsDir = 'phosphor-vue/src/components'
icons.forEach((icon) => {
content += `Vue.component(${icon}, require('${iconComponentsDir}/${icon}.vue'));\n`
})
fs.writeFileSync('./src/phosphor-icons.js', content); main.js import Vue from 'vue'
import './src/phosphor-icons'
new Vue({
el: '#app'
}) |
Have same issue |
Did you use it with Vue 3? On the Vue 3 branch, it says in the docs that there is a known bug in Rollup that prevents tree shaking. I think this issue is related. |
Let's hope the maintainers are still active. Edit: There are a few issues I still need to fix. |
Hey all. Lack of tree-shaking sucks, I'm with you. While my partner and I are generally still quite active on the Phosphor project, I am not a Vue dev, nor am I currently planning to be. This port was originally submitted by a community member, and it'll take community members to keep it running and improving. Being unfamiliar with the state of Vue and its build tools, I don't have a fix for this. But, if you'd like to contribute, or to join as a maintainer, please let me know. |
@rektdeckard Thanks for letting us know! I've fixed tree shakability as well as updated several packages, and brought the project structure to the newest sfc-vue project structure standard. It would be great if you could review it 😄 |
Update: This issue will be solved with the next major release. For now you can install a pre-release alpha version via This solution is for vue 3. |
i am only loading the following
the build result creates big javascript file
The text was updated successfully, but these errors were encountered: