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

Allow exclusion of files from minification step #494

Closed
tlienart opened this issue May 17, 2020 · 6 comments
Closed

Allow exclusion of files from minification step #494

tlienart opened this issue May 17, 2020 · 6 comments

Comments

@tlienart
Copy link
Owner

It was brought to my attention (@tbeason, thanks!) that the minification step of already-minified assets can cause problems (e.g. bootstrap.min.css). It would seem reasonable to just not touch these assets as they, more likely than not, have been expertly optimized.

A kwarg skip_minify = [...] could do the trick in optimize, a global var @def = skip_minify = [] (like ignore)

@zlatanvasovic
Copy link
Contributor

What problems exactly are caused? A slight modification of the minify script can solve this easily (i.e. by ignoring the .min.css / .min.html files).

@tbeason
Copy link

tbeason commented May 26, 2020

In my case, the full CSS stylesheet was not being applied. Some stuff magically worked, other stuff didn't. I also think the easiest way to fix the problem would be to just always ignore files that are already minimized as indicated by their names + a short mention in the docs about it.

@zlatanvasovic
Copy link
Contributor

@tbeason Could you provide more details? It'd be good to know what worked and what didn't so that all possible errors are avoided. 😄

@tbeason
Copy link

tbeason commented May 26, 2020

One thing that for sure didn't work was that the Bootstrap table styles I was trying to apply would not work properly (like row hovering or table striping).

I don't think it really matters much though because the right thing to do is to just not try to minify a file that has already been minified.

@tlienart
Copy link
Owner Author

@zdroid the minification script I'm using here is a python script that's released under LGPL3 so I'm a bit wary of modifying it myself (assuming that's what you suggest), though given I call it (like a bash call), I could modify that call to avoid specific file patterns which would not touch the code.

I haven't tried to reproduce the problem but I would still think that trying to minify an already-minified file is not very clever, whether it can lead to bugs is maybe surprising but it still seems like a good idea to not do it what do you think?

@zlatanvasovic
Copy link
Contributor

Right. Perhaps we can leave them unminified by default, but also add an option to minify them.

@tlienart tlienart mentioned this issue Jun 23, 2020
tlienart added a commit that referenced this issue Jun 29, 2020
* closes #530

* closes #495

* closes #512

* whitespace

* closes #514

* closes #494 by modifying the python script a touch

* small fix

* small fix

* finally ok

* some more silliness

* closes #505

* fixing a few last things
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants