Strange behavior when bundeling and minifying css with ClientDependency
When bundeling and minifying multiple css files with ClientDependency the bundled file contains multiple @charset "UTF-8"; spread out the document.
The css files are compiled from scss files. When compiling the scss files a @charset "UTF-8" is automatically added to each generated css file at the beginning of the file. Then when bundled the file looks something like this:
@charset "UTF-8";
css code from css file 1...
@charset "UTF-8";
css code from css file 2...
@charset "UTF-8";
css code from css file 3...
This will result in a invalid css file, any thoughts?
This is really strange. Now I tried to compile all of my sass files into one single css file. Then using ClientDependency to bundle and minify this single css file. Now the charset UTF-8 is added once at the top as expected but strangely my google font @import is duplicated like this:
@import font... (this is not expected)
@charset... (this is expected)
@import font... (this is expected)
Css styles...
If I remove my single google font @import from my sass file the final bundled and minified css file will as expected not print out any font @import.
This is happening only when debug is set to false, when debug is set to true the file looks as expected with @charset, @import font and the css code below.
Of course I could fetch the google font with the "link" tag, but I'm curious if I'm the only one having lots of issues with the bundling and minifying.
Also, it makes me kind of sad that I'm not able to use "view specific" css files since I'm not able to bundle multiple css files due to the charset UTF-8 issue. I't would be extremely nice not to have one large css file, especially when there is no use of some of the css on certain pages.
Strange behavior when bundeling and minifying css with ClientDependency
When bundeling and minifying multiple css files with ClientDependency the bundled file contains multiple @charset "UTF-8"; spread out the document.
The css files are compiled from scss files. When compiling the scss files a @charset "UTF-8" is automatically added to each generated css file at the beginning of the file. Then when bundled the file looks something like this:
@charset "UTF-8"; css code from css file 1... @charset "UTF-8"; css code from css file 2... @charset "UTF-8"; css code from css file 3...
This will result in a invalid css file, any thoughts?
Hi David,
Maybe it's a option to let sass bundle all your files in to one css ? You can then use ClientDependency to minify this.
Dave
Hi Dave,
This is really strange. Now I tried to compile all of my sass files into one single css file. Then using ClientDependency to bundle and minify this single css file. Now the charset UTF-8 is added once at the top as expected but strangely my google font @import is duplicated like this:
@import font... (this is not expected)
@charset... (this is expected)
@import font... (this is expected)
Css styles...
If I remove my single google font @import from my sass file the final bundled and minified css file will as expected not print out any font @import.
This is happening only when debug is set to false, when debug is set to true the file looks as expected with @charset, @import font and the css code below.
Of course I could fetch the google font with the "link" tag, but I'm curious if I'm the only one having lots of issues with the bundling and minifying.
Also, it makes me kind of sad that I'm not able to use "view specific" css files since I'm not able to bundle multiple css files due to the charset UTF-8 issue. I't would be extremely nice not to have one large css file, especially when there is no use of some of the css on certain pages.
/ David
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion