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
eastern-cyan•2y 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
eastern-cyan•2y 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.
conventional-tanOP•2y 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.conventional-tanOP•2y ago
I already following the starter template from the tanstack router example repo
@Sean Cassiere
eastern-cyan•2y ago
Maybe something is different about your setup?
eastern-cyan•2y 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?eastern-cyan•2y 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
conventional-tanOP•2y 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*
eastern-cyan•2y 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.
conventional-tanOP•2y ago
Umm so that's the rspack work to fix this problem?
eastern-cyan•2y 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.