Skip to content

Resolve @svelteuidev/core to prebundled version #421

@benmccann

Description

@benmccann

Describe the bug

Bug report from Discord: https://discord.com/channels/804011606160703521/1012085571985866914/1012390467331166238

@bluwy stated:

hmm yeah there seems to be an issue with Vite's resolver. It should resolve importing @svelteuidev/core to the one in .vite/deps

Reproduction

npm create vite@latest myapp -- --template svelte-ts

... run npm run dev and it's 21 reqs.

npm i -D @svelteuidev/core

... edit Counter.svelte:

<script lang="ts">
    import {Button} from '@svelteuidev/core';

    let count: number = 0
    const increment = () => {
        count += 1
    }
</script>

<Button on:click={increment}>
    count is {count}
</Button>

... add prebundleSvelteLibraries: true, run npm run dev and it's now 369 reqs and a 4s load time.
@smui or @svelteuidev libraries do show up in node_modules/vite/.deps - but no change in actual behaviour of the requests or bundling that I can see. There is also a message that appears with SMUI stating that it cannot find source for a bunch of @Material deps from SMUI, so that is why I was testing with @svelteuidev as well as it does not have those material deps, but - same issue there

Logs

No response

System Info

tbd

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions