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

Svelte file being listed as a dependency of itself #346

Closed
kaisermann opened this issue Apr 19, 2021 · 0 comments · Fixed by #347
Closed

Svelte file being listed as a dependency of itself #346

kaisermann opened this issue Apr 19, 2021 · 0 comments · Fixed by #347
Assignees
Labels
bug Something isn't working

Comments

@kaisermann
Copy link
Member

kaisermann commented Apr 19, 2021

Reported by @dominikg:

The following component:

<script lang="ts" src="./MultiFile.ts"></script>
<template lang="html" src="./MultiFile.html"></template>
<style lang="scss" src="./MultiFile.scss"></style>

Returns the following deps:

0 = "/home/dominikg/develop/sveltejs/vite-plugin-svelte/packages/playground/svelte-preprocess/src/lib/multifile/MultiFile.html"
1 = "/home/dominikg/develop/sveltejs/vite-plugin-svelte/packages/playground/svelte-preprocess/src/lib/multifile/MultiFile.ts"
2 = "/home/dominikg/develop/sveltejs/vite-plugin-svelte/packages/playground/svelte-preprocess/src/lib/multifile/MultiFile.scss"
3 = "/home/dominikg/develop/sveltejs/vite-plugin-svelte/packages/playground/svelte-preprocess/src/lib/multifile/MultiFile.svelte"
4 = "/home/dominikg/develop/sveltejs/vite-plugin-svelte/packages/playground/svelte-preprocess/src/lib/multifile/_someImport.scss"
length = 5

After some research, I found that the scss transformer is the one returning the parent svelte file as a dependency. This can be easily fixed by filtering it out before returning the processed result. If another transformer shows this behaviour, we can move that logic upwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant