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

migration: remove vitePreprocess or add @migration-task to evaluate usage #312

Open
benmccann opened this issue Oct 21, 2024 · 4 comments
Open
Labels
enhancement New feature or request pkg:migrate svelte-migrate

Comments

@benmccann
Copy link
Member

Describe the problem

@bluwy @dominikg is vitePreprocess used for anything besides typescript support?

Describe the proposed solution

Remove vitePreprocess from the svelte config file or add @migration-task instructing the user to evaluate its usage. It is primarily used for TypeScript support and I think that exists natively in Svelte 5 now so that preprocessors are no longer required?

Importance

nice to have

@dominikg
Copy link
Member

vite-plugin-svelte 4 defaults to script: false for vitePreprocess and only uses it for style preprocessors. This is important for scss and any other postcss things the user might have that sveltes native css parser can't handle.

So you can only remove it if you are sure the user has not syntax in their svelte style blocks that would throw for svelte parse

@dummdidumm
Copy link
Member

Migration task comment is probably good, but for both ways: you can either remove it, or you need to add script: true if your code uses TS syntax that isn't type only

@MotionlessTrain

This comment was marked as duplicate.

@dominikg
Copy link
Member

is the migration script able to determine if any typescript syntax was used that requires it? (i'd assume you can try to compile and if it gives a script syntax error you try again with vitePreprocess({script: true}) and if that fixes the error you add it in the migration....

@manuel3108 manuel3108 added enhancement New feature or request pkg:migrate svelte-migrate labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:migrate svelte-migrate
Projects
None yet
Development

No branches or pull requests

5 participants