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
[v8] Missing tree shaking support #8112
Comments
I can confirm - using with vite / SvelteKit results in a 4.4Mb JS page where an icon is used. Changing the import to be |
Bump. I'm really surprised not many people seem to care about/aware of this |
How many have done a release over Christmas and used the latest version and then noticed that their bundle size has exploded? It doesn't break, it would just make some pages slow AFAICT |
For anyone, who's using Next.js 13.1: I solved this by adding the following to my modularizeImports: {
"simple-icons": {
transform: "simple-icons/icons",
preventFullImport: true,
skipDefaultConversion: true
}
}, You can do something similar with babel-plugin-transform-imports apparently. |
Are you using JS? Because TS doesn't seem to be happy when this is applied. |
I'm using TypeScript. I don't get any errors. |
I had the same issue and worked around it in esbuild with package aliasing: await esbuild.build({
entryPoints: ['app.js'],
bundle: true,
write: true,
alias: {
'simple-icons': 'simple-icons/icons',
},
treeShaking: true,
}) |
Hi, could you confirm that applying the next patch to |
I just tested it by manually changing `package.json` like in the diff and
can confirm that it solves the problem.
…On Fri, Feb 10, 2023 at 3:41 AM Álvaro Mondéjar ***@***.***> wrote:
Hi, could you test that applying the next patch to
node_modules/simple-icons/package.json the problem is solved?
develop...possible-patch-8112
#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L14-R19
<develop...possible-patch-8112#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L14-R19>
—
Reply to this email directly, view it on GitHub
<#8112 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGXX6R3QW6SX3IU2OI2SM3WWVCAHANCNFSM6AAAAAASU6W2VU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
See simple-icons/simple-icons#8112. Signed-off-by: William So <polyipseity@gmail.com>
Kind of Issue
Bug
This issue concerns the...
NPM package
Package Version
8.0.0
Other Software
None
Description
In v8, the tree-shaking capability is missing despite how the README suggests.
Steps to reproduce
simple-icons
v8.Expected behavior
Tree shaking is supported, just like when we used to import icons from
simple-icons/icons
in v7.The text was updated successfully, but these errors were encountered: