Description
Hi there,
Maybe this is something I'm misunderstanding about the default configs, but in other instances I've used Webpack it's always skipped bundles that hadn't changed. In my project I have 2 entry points assets/javascript/packs
. I did this for 2 reasons:
- After adding Tailwind to my project and following a couple of basic tutorials to get it going, my build time went from a second or so to 35 to 50 seconds every time I touched a JS file. My thinking was that it was detecting that something in the pack changed so it had to rebuild it all so:
- Moved the Tailwind import to a separate
core.js
"pack" so it was like so:
import '../css/application.css'
(That's literally all I have in it)
Both packs are linked into my standard template like you would expect. I have tried javascript_packs_with_chunks_tag
and javascript_pack_tag
to note.
Now the crux of the issue is, my application
bundle is now 249 KiB, my core
is 5.32 MiB (with a 5.36 MiB map). I can change nothing that core
touches but it is always rebuilt when modifying even a single character that is held within the application
package. I would have expected that since core
hadn't changed at any level it would use the previous build. Is there something I'm missing that is causing this continual re-compilation? With the Tailwind import commented out the build time goes down to 10s, but it still re-compiles both for some reason, but at least its only 10s. These times are still much higher than I'd expect, but I'd like to try and solve one issue at a time.
Any help with this would be greatly appreciated.
EDIT:
I should add I realize there is likely some time hit due to my setup (WSL), but not this much of a time hit:
Windows 10 (H20 update)
WSL 2 (Ubuntu 20.04)
Ruby 2.7.2
Rails 6.1.0
Webpacker 5 (in Gemfile)