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

Add prefix to JS assets #175

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

Conversation

manuelmeurer
Copy link

@manuelmeurer manuelmeurer commented Oct 14, 2024

I noticed that MCJ overwrites some of my app's importmap includes, e.g.

"controllers": "https://myapp.com/assets/controllers/index-be0771f7.js"

becomes

"controllers": "https://myapp.com/assets/mission_control/jobs/controllers/index-77c24c3f.js"

after including this gem.

This PR fixes that by prefixing all JS assets with "mcj-" and preloading them only when the "mcj" entry point is loaded.

@manuelmeurer
Copy link
Author

I recommend merging #163 instead of this PR, it implements a completely separate importmap, which is a cleaner option.

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.

1 participant