Skip to content

Update README.md #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update README.md #237

wants to merge 1 commit into from

Conversation

rip747
Copy link

@rip747 rip747 commented May 19, 2025

Add example of adding a a custom assets path to propshaft

Add example of adding a a custom assets path to propshaft
@@ -16,7 +16,9 @@ With Rails 8, Propshaft is the default asset pipeline for new applications. With

## Usage

Propshaft makes all the assets from all the paths it's been configured with through `config.assets.paths` available for serving and will copy all of them into `public/assets` when precompiling. This is unlike Sprockets, which did not copy over assets that hadn't been explicitly included in one of the bundled assets.
Propshaft makes all the assets from all the paths it's been configured with through `config.assets.paths` available for serving and will copy all of them into `public/assets` when precompiling. This is unlike Sprockets, which did not copy over assets that hadn't been explicitly included in one of the bundled assets. As an example, supposed you are vendoring libraries into a custom components path under the "vendor/assets" directory, thus the full directory is "vendor/assets/components". In order for Propshaft to use the libraries in this path you would have to add the following in your config/application.rb:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this example is on the wrong place. Pehaps it should be its own section, but this behavior is the same on sprockets.

I'm not even sure this is correct. Propshaft should be adding directories inside vendor/assets automatically. So why do you think you need to document this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants