-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rework to use the compiler directly and support svelte-preprocess #1
Comments
Oh gosh! I've not tried, though my work may be moving toward using typescript so that might become an issue where I use this too. |
Ooh. It looks like this would be somewhat more than trivial: preprocess is an async process, and node's require is synchronous. That means reworking this to use the svelte compiler directly rather than the registered require hook. It's probably not too hard — the relevant code in rollup-plugin-svelte is not too bad, so I'd have to start with that to replace the require hook. That would solve my cache invalidation problem too, so there's benefit to doing it. I don't have a lot of time to work on this right now, but I'd totally support you in making it happen and accept it as a pull request. |
Hm, interesting. I also noticed that using ES modules (as it is default with sveltekit) clashes with the fractal engine, as it isn't compatible with ES modules, see: frctl/fractal#1024 So if I create a component that has an |
That would probably work. That whole business is a bees nest, to be honest. Node went some difficult to manage places with its esm loader, so it's all just a big mess. Embedding rollup would probably work to do that conversion, but that's bringing in a LOT of infrastructure. It might be needed to run svelte code through rollup and rollup-plugin-svelte instead of just the svelte compiler to get commonjs output. |
That said, I actually use imports in our styleguide, within svelte. That's fine — it's modules that aren't svelte that use import where things start getting wild. |
I'm currently trying to integrate a fractal styleguide into a sveltekit project… one of the issues I'm facing is that this adapter doesn't seem to invoke the preprocessor.
Do you have any pointers/hints how this could be accomplished?
The text was updated successfully, but these errors were encountered: