tajo / ladle

🥄 Develop, test and document your React story components faster.
https://www.ladle.dev
MIT License
2.63k stars 93 forks source link

Vite HMR config does not override Ladle default config #557

Closed gapark closed 5 months ago

gapark commented 7 months ago

Describe the bug

When trying to use vite.config.mjs to override the default HMR settings (server.hmr) the settings in vite.config.mjs are never applied.

Reproduction

I'm trying to run ladle within a docker container. The problem I am having is that the WS connection to my docker container fails and to fix this I need to override the HMR host. Essentially:

To reproduce this issue simply attempt to change server.hmr.host or server.hmr.port in your .ladle/vite.config.mjs and it will not be applied.

I think I have found the issue within the codebase:

Potential Fix

I'm not 100% certain, but from a quick glance I think a fix would be adding HMR settings to the ladle config, and then merging them in here as we do with the other settings in the ladle config.

gapark commented 7 months ago

This PR is not ready to be merged, I don't have time to get the project set up locally right now to test things fully, but this should be a good example of a fix for the problem: https://github.com/tajo/ladle/pull/558

gapark commented 6 months ago

@tajo any chance you could help me get a fix together and merged for this? I've already attempted a PR here #558, any suggestions or assistance would be greatly appreciated. 🙇🏻