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

Any way to prevent require from including "core" etc again? #66

Closed
jarodtaylor opened this issue Apr 8, 2014 · 2 comments
Closed

Any way to prevent require from including "core" etc again? #66

jarodtaylor opened this issue Apr 8, 2014 · 2 comments

Comments

@jarodtaylor
Copy link

We have our application.js manifest with jquery.ui being required and a couple widgets included as well. There are certain parts of the application that we use one off widgets and we want to just include it on that page alone. We will have a page specific javascript file included on that page and add require rules in it for any 'one off' JS files. Example:

application.js may have:

//= require jquery.ui.datepicker

admin_page.js may have:
//= require jquery.ui.sortable

Unfortunately when using this gem I will now have jquery.ui.core jquery.ui.widget, etc. included again (once from the application.js file and again in the admin_page.js file).

@joliss
Copy link
Member

joliss commented Apr 11, 2014

I'm not sure that there is a way to do this. If you need control this fine-grained, you maybe should be adding the original jQuery UI files manually to your vendor directory, rather than using this gem.

Unsolicited advice: I'd generally advise against trying to optimize for a few extra KB in your CSS. It makes development a lot harder, but buys very little in terms of performance.

@rosenfeld
Copy link
Collaborator

This is how the Rails Assets Pipeline (sprockets) works. There's nothing we can think of to help you with your requirements. If you have a suggestion on how to change this gem to support your workflow please let us know and I'll reopen this ticket.

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

3 participants