# Add a script to Discourse's webpack

**URL:** <https://meta.discourse.org/t/add-a-script-to-discourses-webpack/314394>\
**Category:** Development\
**Tags:** unsupported-install\
**Created:** [July 1, 2024, 4:40am UTC](https://meta.discourse.org/t/add-a-script-to-discourses-webpack/314394 "2024-07-01T04:40:04Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [July 1, 2024, 4:27pm UTC](https://meta.discourse.org/t/add-a-script-to-discourses-webpack/314394/3 "2024-07-01T16:27:03Z")

</div>

We don’t use the browser’s native module resolution system, so `<script type="module">` with imports and exports won’t work as you expect.

Instead, you can create an initializer in a Discourse theme/plugin, and use that to run the `loadSprites()` code.

> [@darkpixlz](#):
>
> you can put anything where the - is so I’m not quite sure why it exists in the first place but thats not up for me to decide

It’s for hosting environments where the same CDN domain is used by multiple Discourse forums.

> [@darkpixlz](#):
>
> I have a Discourse install running off an IP, which is “unsupported”

Indeed… it is not supported. You are very likely to run into other issues.

---

_[View the full topic](https://meta.discourse.org/t/add-a-script-to-discourses-webpack/314394)._
