Skip to content
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

Custom logical paths #5

Open
ersinakinci opened this issue Jun 24, 2016 · 4 comments
Open

Custom logical paths #5

ersinakinci opened this issue Jun 24, 2016 · 4 comments

Comments

@ersinakinci
Copy link
Contributor

ersinakinci commented Jun 24, 2016

The plugin currently doesn't allow for customizing logical paths, which means that each logical path is simply the pathname of the corresponding source file relative to the sourceAssetsPath.

This behavior can a problem for using generated assets manifests with Rails views. For instance, if your assets are organized in a source directory using Rails' canonical app/assets/{images, stylesheets, javascripts} hierarchy and your sourceAssetsPath is app/assets, your images' logical paths will all be prefixed with images (e.g., app/assets/images/hello.png --> images/hello.png) . The result is incompatible with commonly used Rails helpers like image_tag, which accept unprefixed logical paths (e.g., image_tag 'hello.png').

@mikechau
Copy link
Owner

I'll keep this open until a new version is published.

@ersinakinci
Copy link
Contributor Author

Just realized that I made a mistake in removing what I called "redundant code" for determining the logical paths. The code that I removed was for adding assets that were added from chunks to the manifest (e.g., Javascript entry point files). I'm creating a new PR to rectify the issue.

@mikechau
Copy link
Owner

mikechau commented Jun 28, 2016

@earksiinni ah, I also noticed that and have reverted that change PR #7. Hopefully I caught you in time!

@mikechau
Copy link
Owner

Hey @earksiinni if you could provide a sample configuration of the logic paths and what you'd expect the json to look like - that'd be really helpful for me. Thanks!

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

No branches or pull requests

2 participants