Skip to content
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

$lib imports won't result in correct path - no such file or directory #116

Open
silkroadnomad opened this issue Aug 24, 2023 · 0 comments
Open

Comments

@silkroadnomad
Copy link

When parsing a Svelte component that imports paths with an alias (paths defined in tsconfig.json) such as $lib, Sveld cannot substitute the correct path.

Example:
Given an import path:
import ExampleComponent from '$lib/components/ExampleComponent.svelte';
results into error:

[Error: ENOENT: no such file or directory, open '/Users/xyz/Documents/example-project/src/lib/$lib/components/ExampleComponent.svelte']

QuickFix:
I added the following two lines to line 108 in sveld/lib/parse-export.js

node.source.value = node.source.value.replace('$lib/','')
console.log("-->parsing ImportDeclaration",node.source.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant