# Introducing pre-compiled JS assets for self-hosters

**URL:** https://meta.discourse.org/t/introducing-pre-compiled-js-assets-for-self-hosters/376700
**Category:** Announcements
**Created:** [July 31, 2025, 4:25pm UTC](https://meta.discourse.org/t/introducing-pre-compiled-js-assets-for-self-hosters/376700 "2025-07-31T16:25:05Z")
**Posts on this page:** 1
**Showing post:** 1

<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 31, 2025, 4:25pm UTC](https://meta.discourse.org/t/introducing-pre-compiled-js-assets-for-self-hosters/376700/1 "2025-07-31T16:25:05Z")

</div>

📣 Discourse now publishes pre-built JavaScript assets, which will significantly speed up installation and updates, especially for servers with limited resources.

* * *

Compiling and optimizing JavaScript assets has always been one of the most resource-intensive parts of running Discourse. As our codebase and the JavaScript ecosystem have evolved, this process has become even more demanding.

In our tests, these changes reduce the asset-build time on a 1GB RAM Digital Ocean droplet from 45 minutes to just 3 minutes.

### How does it work?

On every commit merged to `main`, a [GitHub Actions workflow](https://github.com/discourse/discourse/blob/main/.github/workflows/publish-assets.yml) builds and bundles the assets into `.tar.gz` files (one for production, one for development). These bundles are published [via GitHub releases](https://github.com/discourse/discourse-assets/releases) in a dedicated repository. We ensure assets are published before any commit moves to `tests-passed`.

When building your own site, Discourse now checks for a matching pre-built bundle and downloads it. Plugins are then built on top. If no bundle is found or there’s an error, Discourse falls back to building from source.

### Does this impact end-users?

No. Assets are still served to end-users from your own server / CDN.

### Can I opt out?

Yes! If you prefer to build your own assets and have a sufficiently powerful server, set `DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS: 0` in your `app.yml` file.

### What if I’m running a forked or patched version of Discourse?

Asset bundles are named by commit hash. If you’re running a fork, no bundle will be found and assets will build from source. If your Discourse copy is patched (i.e., the git working tree isn’t clean), Discourse will not attempt to download a bundle.

### What about other asset-related build steps?

Currently, this optimization applies only to core JS assets. In the future, we may expand it to some plugins and other steps like gz/brotli compression.

### What about the stable branch?

Pre-built assets for the stable branch will be published starting with the next major version bump, planned for August 2025.

---

_[View the full topic](https://meta.discourse.org/t/introducing-pre-compiled-js-assets-for-self-hosters/376700)._
