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

Does watching with Vite still work? #16

Closed
goswinr opened this issue Apr 11, 2024 · 2 comments
Closed

Does watching with Vite still work? #16

goswinr opened this issue Apr 11, 2024 · 2 comments

Comments

@goswinr
Copy link

goswinr commented Apr 11, 2024

I updated to the latest version of Fable , SolidJs, Vite and vite-plugin-solid.
Fable build and watch to recompile to .jsx works, but Vite does not seem to pick up any changes and reload the browser.
Please test it on this minimal app: https://github.com/goswinr/Fable.Solid-Test

@MangelMaxime
Copy link
Member

Hello @goswinr,

You are probably hitting fable-compiler/Fable#3631.

There is an issue when spawning Vite from Fable command when in watch mode.

Change dotnet fable watch --noCache --outDir ./dist --extension .jsx --run vite to spawn manually spawn 2 terminals or by using concurrently.

Warning

Pseudo code

"scripts": {
	"watch-vite": "npx vite ...",
	"watch-fable": "dotnet fable watch ...",
	"watch": "npx concurrently \"npm:watch-*\"",
}

@goswinr
Copy link
Author

goswinr commented Apr 12, 2024

Thanks @MangelMaxime, I always learn something new from you . But in my case --run vite actually works fine.

My problem was that vite ignores the dist folder. So just use another --outDir
And for solidjs it only watches child components below the root in separate files correctly. I believe this is from the vite-plugin-solid plugin.

I fixed my minimal sample here, see my comments: goswinr/minmal-Fable.Solid-Template@6d7a38d#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

@goswinr goswinr closed this as completed Apr 12, 2024
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

2 participants