Add a script to Discourse's webpack

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.

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

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

2 Likes