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

Split preprocessing and compiling into separate plugins #729

Open
benmccann opened this issue Aug 29, 2023 · 0 comments
Open

Split preprocessing and compiling into separate plugins #729

benmccann opened this issue Aug 29, 2023 · 0 comments
Labels
enhancement New feature or request triage Awaiting triage by a project member

Comments

@benmccann
Copy link
Member

Describe the problem

I'd like to use https://github.com/antfu/vite-plugin-inspect to see the result of preprocessing. It shows the result of each Vite plugin. Since preprocessing and compiling currently happen in the same plugin it shows them occurring as a single step

Describe the proposed solution

Split preprocessing and compiling into separate plugins.

I took a quick stab splitting them into separate methods (but still within a single plugin) here: https://github.com/benmccann/vite-plugin-svelte/tree/split-preprocessing. It seems I broke the tests with my attempt. It'd probably be better for someone more familiar with the codebase to do it

Alternatives considered

We could split each preprocessor into its own plugin. I think this would be more trouble than it's worth though. E.g. right now Svelte combines the source maps from all the preprocessors. We'd have to do the same and ensure we were giving the same results as Svelte. I think it'd be a lot easier to handle all preprocessors together in a single plugin and that will still provide a lot of value.

Importance

nice to have

@benmccann benmccann added enhancement New feature or request triage Awaiting triage by a project member labels Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Awaiting triage by a project member
Projects
None yet
Development

No branches or pull requests

1 participant