Closed TheEisbaer closed 3 months ago
Proposed solution:
final package.json has to look like this:
"exports": {
".": {
"types": "./dist/tabler-icons-svelte.d.ts",
"svelte": "./dist/tabler-icons-svelte.js",
"default": "./dist/tabler-icons-svelte.js"
},
"./icons": {
"types": "./dist/tabler-icons-svelte.d.ts",
"svelte": "./dist/tabler-icons-svelte.js"
},
"./icons/*": {
"types": "./dist/icons/*.svelte.d.ts",
"svelte": "./dist/icons/*.svelte"
}
}
then you can import the icons like:
import IconAB from '@tabler/icons-svelte/icons/a-b'; // fast during build and dev server
// or
import { IconAB } from '@tabler/icons-svelte'; // still slow during build and dev server because vite still transforms every icon
Results in much faster IDE performance
Package
Version
@latest
Browser
Operating system
Description
VSCode and Intellisense (especially the language servers) are slowing down (taking up to 40 seconds for auto complete) because of the huge amount of export conditions (one for each icon) in the package.json
See https://github.com/sveltejs/language-tools/issues/2244 for advice on fix for this
Steps to reproduce
Checklist