layerchart icon indicating copy to clipboard operation
layerchart copied to clipboard

Support importing individual components (to reduce bundle size)

Open techniq opened this issue 5 months ago • 0 comments

Instead of requiring:

import { Axis, Chart, Layer } from 'layerchart';

we should also support direct component imports using:

import Axis from 'layerchart/Axis.svelte';
import Chart from 'layerchart/Chart.svelte';
import Layer from 'layerchart/Layer.svelte';
"exports": {
    "./*.svelte": {
        "import": "./dist/components/*.svelte"
    },
    ...
}

or

import Axis from 'layerchart/components/Axis';
import Chart from 'layerchart/components/Chart';
import Layer from 'layerchart/components/Layer';

using:

"exports": {
    "./components/*": {
        "import": "./dist/components/*.svelte"
    },
   ...
},

techniq avatar Jul 23 '25 22:07 techniq