minify icon indicating copy to clipboard operation
minify copied to clipboard

Method for get list of imported css

Open yr4ik opened this issue 7 years ago • 6 comments

original #257 I can't get list list of imported css. Example:

@import "child.css";
@import "child2.css";

body {
	font-weight: bold;
}
.......

I can not get list of imported css (child.css and child2.css). And I can not get filelist for check their modification time. This is very inconvenient when doing caching.

Add this function is not difficult. You can change method load of class Minify.

yr4ik avatar Nov 26 '18 22:11 yr4ik

@import is parsed by the client, not the server. You may remove them from your main css and add them to the minification process in the server side.

enricodias avatar Apr 20 '20 15:04 enricodias

ок. maxImportSize = 5 Image bg.jpg (size 1kb)

div {
   background: url(bg.jpg);
}

When compilation is completed, we will get picture in base64 encode. When picture is modified - css won't update.

yr4ik avatar May 31 '20 09:05 yr4ik

The CSS will only update when you minify the file again. This lib doesn't monitor your images.

enricodias avatar May 31 '20 14:05 enricodias

this library replaces images in method CSS->importFiles.

div {
   background: url(bg.jpg);
}

after:

div {
   background: url(ata:image/jpeg;base64,[base64 of bg.jpg]);
}

After changing bg.jpg file is not update.

Library does not have functions to get list of replaced files. There is no way to check changes in image files

yr4ik avatar May 31 '20 21:05 yr4ik

Yes, I saw that the lib can import images into a single css file but the original filename is not saved in the minified version. If you change those images, you'll have to minify the files again using the original css files.

Minified files are not made to be edited. You should work on your original files recreate the minified versions in every modification.

enricodias avatar May 31 '20 22:05 enricodias

I already did this in my application.. I'm just writing about the lack of refinement in the library to get a list of imported files. Because of this, the application cannot control the change of imported files.

yr4ik avatar Jun 01 '20 09:06 yr4ik