> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/programmy/rails/upgrading-your-manifest-for-sprockets-4.md).

# Upgrading Your Manifest For Sprocket's 4

If you're upgrading [Rails](https://github.com/rails/rails) and it involves bumping the [Sprockets](https://github.com/rails/sprockets) dependency from 3.x to 4.x, you may need to update your `manifest.js`.

> Since the default logic for determining top-level targets changed, you might find some files that were currently compiled by sprockets for delivery to browser no longer are. You will have to edit the `manifest.js` to specify those files.

> The `manifest.js` file is meant to specify what files to use as a top-level target using sprockets methods `link`, `link_directory`, and `link_tree`.

You can specify what top-level assets like so:

```javascript
# app/assets/config/manifest.js

//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link some_file.xml
//= link some/nested/style.css
```

Read more about the [upgrade process here](https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs) as well as in [this blog post](https://eileencodes.com/posts/the-sprockets-4-manifest/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ploegert.gitbook.io/til/programmy/rails/upgrading-your-manifest-for-sprockets-4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
