jingo-minify icon indicating copy to clipboard operation
jingo-minify copied to clipboard

Change bundle path and fix relative URL's

Open rehandalal opened this issue 12 years ago • 13 comments

Feel free to say: "THESE ARE USELESS CHANGES AND NOBODY NEEDS THEM!".

This does a couple of things:

  • CSS bundles will now be in ~~MEDIA_PATH/bundled/css~~ MEDIA_PATH/BUNDLES_DIR/css
  • JS bundles will now be in ~~MEDIA_PATH/bundled/js~~ MEDIA_PATH/BUNDLES_DIR/js
  • Relative URL's in CSS will now be fixed to point to the correct URL when bundled. (This was a problem on SUMO and recently on Input)

r?

rehandalal avatar Feb 24 '13 04:02 rehandalal

I should also probably point out the reason for bundling to the bundled folder.

I happened to have a bundle called jquery and sadly one of the files in the bundle was jquery-min.js which (you guessed it) got replaced with the bundle file.

Now admittedly, this is a silly edge case that would normally not be an issue, and is pretty easy to get around. But I generally like the idea of tossing bundled files in another folder because it also keeps file clutter down in my js/css folders.

rehandalal avatar Feb 24 '13 06:02 rehandalal

If someone updates to this, will they be hosed? Are there things they need to do to update to this version?

willkg avatar Feb 24 '13 14:02 willkg

@willkg with the new change to the default value of BUNDLES_DIR there should be no compatibility issues.

rehandalal avatar Feb 25 '13 08:02 rehandalal

Test added ^

rehandalal avatar Mar 07 '13 02:03 rehandalal

And now tests pass ^

If this is all good I'll squash and push

rehandalal avatar Mar 07 '13 02:03 rehandalal

@cvan any outstanding comments here? @rehandalal Still want to get this merged in?

jsocol avatar Oct 28 '13 22:10 jsocol

I can't understand why there is the /bundled/ path still hard-coded in some places given that there is a setting for that path.

davidbgk avatar Apr 09 '14 14:04 davidbgk

I just did the following:

  • Rebased/squashed the original commits in this pull request and fixed all the conflicts
  • Updated the tests to be more thorough

I still think this is pretty useful!

r?

rehandalal avatar Nov 01 '14 17:11 rehandalal

@jsocol think you could have a quick look-see at this? THANKS!

rehandalal avatar Nov 11 '14 07:11 rehandalal

I can but not for another day or so, and I don't have the context that @cvan would

jsocol avatar Nov 11 '14 19:11 jsocol

looking good. sorry it's taken so long to get this in. I don't think we've understood the use case here, hence the delays.

cvan avatar Nov 12 '14 23:11 cvan

I'll clean up the code.

For me, this is why I made the changes:

  • Having a special directory that bundles get stored in makes it easier for me to filter those files out through .gitignore. I also had one edge case where I had a file which shared the same name as the final minified bundle that it belonged to which caused a whole mess. Admittedly that's easily fixed by renaming the file or the bundle but I prefer this.
  • Fixing the relative URLs helps when you're bundling files that are installed by bower and they have additional image assets that are linked to such as FancyBox. Without this, sometimes I have to copy these image files into the css folder or other places and that was just getting messy.

rehandalal avatar Nov 12 '14 23:11 rehandalal

@cvan fixed based on feedback ^

rehandalal avatar Dec 04 '14 00:12 rehandalal