Comments (3)
Hey @vladimmi
I've been thinking about it.
I definitely like the gzip idea, although I wouldn't do it as part of minify() function. How about creating a new method in Minify.php? Something along these lines:
public function gzip($path, $level = 9)
{
$content = $this->execute($path);
$content = gzencode($content, $level)
// save to path
if ($path !== null) {
$this->save($content, $path);
}
return $content;
}
What do you think about this?
I also like the other idea, I'm just not really sure it belongs in minifier :p I'll think about that some more.
from minify.
How about creating a new method in Minify.php?
Sure, you are free to do it as you wish
I also like the other idea, I'm just not really sure it belongs in minifier :p
That's why I decided to ask before starting to make tests and PR :) Pretty similar to image embedding (make one bigger file instead of many small requests) but... Got some troubles while thinking about that idea:
- unlike CSS, such JS code doesn't work without minifier. So it becomes something like builder, not just minifier. Wasn't problem for my project but can be for others.
- that can be workarounded but needs some additional JS code. Like
var template = Foo.load('path/to/file');
and use that call as directive to embed template. But used paths can be relative to script (which are impossible to resolve from browser, as I know) or relative to root (and we need to set some root path to find them in minifier, making usage harder)...
Maybe you'll have some inspiration and better ideas :)
from minify.
Just included gzip()
method in 30a4592 - thanks for the idea!
I'm not going to go ahead with the other idea, for exactly the same reasons you already listed - haven't been able to come up with great solutions myself :)
from minify.
Related Issues (20)
- Problem with a specific file, Choices.js HOT 1
- Problem with units HOT 3
- Syntax error on minified JS - missing semicolon after empty for
- Removing styles with value "none" HOT 2
- This is a test
- Latest release broke our minified JS result
- Syntax error on minified JS - missing semicolon after empty if HOT 1
- Calc function missing on background-position property
- advice for cache HOT 1
- CSS variable value 0px has the px removed and breaks
- Class 'MatthiasMullie\Minify\CSS' not found HOT 2
- JS line comment not working - SOLVED.
- text onchange in the script HOT 1
- incorrect behavior when ยซ\\ยป in JS
- Multiline comments not always stripped HOT 2
- Big performance loss in CSS-minify HOT 10
- Invalid max syntax on output
- CSS variables with default values lose their units which makes calculations that they participate in invalid HOT 2
- Class "MatthiasMullie\PathConverter\Converter" not found HOT 2
- Minify is not minifying JS/CSS files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minify.