-
Notifications
You must be signed in to change notification settings - Fork 33
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
allow multiple chunks of compressed script? #29
Comments
It sounds like maybe the greenscript plugin would be better for your needs? |
Does greenscript allow this? |
I haven't looked at it for a while, you'd need to check the documentation to see if it's possible. Press is designed to be as simple as possible; at present you can create individually compressed files and a single aggregate file, but you can't divide files into groups to be aggregated. |
It would be great to add this - for example, just add a 'key' parameter to #{press.script} which specifies which group the file is added to. This would be very helpful in my case where i have ~20 common JS files and then 1-2 specific files per-screen. Without the groups the initial 20 will have to be re-downloaded once for each page, negating a lot of the speed benefit gained by using press. |
Yeah I see what you're saying, let me think about the best solution to that problem |
Thanks! I did re-read the docs and noticed it sounds like the generated filenames are based off of the target URL, so for this to work completely maybe that would also have to change to only reflect the files being combined - that way if two pages referenced the same set of JS not only would the press backend use it's cache but the browser cache could work too because the generated filename wouldn't change. Either way, great work on this module - it's as easy to use as the LESS one (drop-in and it just works) and vastly simpler than greenscript. |
Actually have you tried adding the files using #{press.single-script 'file.js' /}? You may find that it's actually faster than having the files aggregated into groups, because the browser will download them in parallel (it will cache them so they won't be re-downloaded for each page) |
That's what I'm doing now - seems fine if the # of page-specific files stays low. |
Ok great. The idea with press was to try to make it as simple as possible, with nothing for the user to really think about, just change the tag name and it should do everything automatically for you. That's why I'd prefer not to introduce any complicating features if possible. |
Yeah, totally understand, and that's one of the things that makes press great. I'll see if I can get any performance #s when we move this to production to gauge if there is a compelling enough reason to consider this. |
Cool, let me know what you find |
I want to combine 2-3 different scripts into one file and the rest into another. Does not seem possible with press right now and I seem to end up with one monolithic js file.
The text was updated successfully, but these errors were encountered: