Need to refresh manually when using tailwind with rsbuild
"I am encountering an issue while using Tailwind with Rsbuild. Whenever I make changes to the code, I find myself needing to manually refresh the page for the modifications to take effect."ind with rsbuild, when i trying to make a change in code i need to refresh the page manually to make the changes happen
11 Replies
other-emerald•15mo ago
I can't seem to reproduce the issue you mentioned.
Please add a minimal reproduction demonstration the issue.
You can fork and create a rsbuild reproduction from here: https://stackblitz.com/github/TanStack/router/tree/main/examples/react/quickstart-rspack-file-based
StackBlitz
Router Quickstart Rspack File Based Example - StackBlitz
Run official live example code for Router Quickstart Rspack File Based, created by Tan Stack on StackBlitz
other-emerald•15mo ago
Actually now that I think about it, the reproduction may not work on Stackblitz since its Rust based. Maybe, a github repo would be better. Just please make sure its a minimal reproduction.
absent-sapphireOP•15mo ago
The changes are currently limited to the
index.tsx
file, which I manually crafted based on the documentation for the TanStack router. Whenever I add a new route and automatically generate it, I find myself having to manually refresh the page whenever I modify the Tailwind class color.absent-sapphireOP•15mo ago
I already following the starter template from the tanstack router example repo
@Sean Cassiere
other-emerald•15mo ago
Maybe something is different about your setup?
other-emerald•15mo ago
Nevermind, I figured it out.
Its because, of the
.lazy
extension.
Its probably some intricate webpack/rspack detail.
if possible, could you just use the experimental.enableCodeSplitting
flag?other-emerald•15mo ago
Code Splitting | TanStack Router React Docs
Code splitting and lazy loading is a powerful technique for improving the bundle size and load performance of an application.
Reduces the amount of code that needs to be loaded on initial page load
absent-sapphireOP•15mo ago
@Sean Cassiere Can you create new route file? And trying to update the code, I think it won't work. In my code index and about file is working fine too, but when i'm trying to create new file route it's need to refresh manually the page to take the changers
changes*
other-emerald•15mo ago
webpack/rspack things 😅
need to figure out how to rebuild modules
making it work should be interesting... since webpack/rspack has no concept of watching for new file changes.
absent-sapphireOP•15mo ago
Umm so that's the rspack work to fix this problem?
other-emerald•15mo ago
For now I'd remove all the
.lazy
extensions and use the experimental.enableCodeSplitting
flag instead.
Figuring out this one could be a bit difficult.