# js.Batch with simple global script

**URL:** <https://discourse.gohugo.io/t/js-batch-with-simple-global-script/53002>\
**Category:** support\
**Created:** [January 4, 2025, 9:20pm UTC](https://discourse.gohugo.io/t/js-batch-with-simple-global-script/53002 "2025-01-04T21:20:34Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jzeneto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jzeneto/32/9539_2.png) [@jzeneto](https://discourse.gohugo.io/u/jzeneto)\
**Post date:** [January 5, 2025, 11:28pm UTC](https://discourse.gohugo.io/t/js-batch-with-simple-global-script/53002/5 "2025-01-05T23:28:57Z")

</div>

Thank you, @bep , it really works without the Defer!

> [@bep](#):
>
> If you’re only adding 1 script into 1 group, then most of the benefits of this js.Batch function goes away (that is: code splitting). You do get CSS support and the “runner” thing, though, so if that’s the case, then it makes sense.

Maybe I’ve poorly explained my case: I have one _entry point_ module, which itself imports many others, most of them dynamically (via `import()`). Before `js.Batch`, all those modules ended up in one single, giant file. Now they are correctly split and only get loaded when needed. So, I do benefit from code splitting.

I couldn’t understand the reasoning of the CSS support, nor the “runner” thing, but they seem to relate to frameworks (React and the like), am I wrong? I don’t use any framework, just TailwindCSS (even without their UI components).

---

_[View the full topic](https://discourse.gohugo.io/t/js-batch-with-simple-global-script/53002)._
