Skip to content

Support importing individual components (to reduce bundle size) #618

@techniq

Description

@techniq

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"
    },
   ...
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Up next

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions