Issue Bug Closed

#91263disableCompression is not respected when CSS are concatenated

Xavier Perseguers 05/02/20, 11:17 updated 07/17/24, 12:17

Description

I am using this:

page.includeCSS {
    // some CSS

    ekkoLightbox = path/to/ekko-lightbox.css
    ekkoLightbox.disableCompression = 1
}

As such I expect this CSS to be concatenated with any other CSS but not compressed at all, thus simply concatenated.

I am not using any 3rd-party compression tool, Core one.

This CSS (see attachment) is already compressed and contains some comments which are actually needed for embedded resources to be taken into account, this is the reason why I don’t want any further compression on it.

Problem is that disableCompression is only taken into account when CSS (possibly JS?) are NOT concatenated. This originates from \TYPO3\CMS\Core\Resource\ResourceCompressor::concatenateCssFiles:135 where we read

            $targetFile = $this->createMergedCssFile($filesToInclude);
            $concatenatedOptions = [
                'file' => $targetFile,
                'rel' => 'stylesheet',
                'media' => $mediaOption,
                'compress' => true,
                'excludeFromConcatenation' => true,
                'forceOnTop' => false,
                'allWrap' => ''
            ];

Thus the files to be concatenated are concatenated and afterwards the file is marked as to be compressed.

I would expect each file to be compressed (or not) and then concatenated. Possibly the file would be very slightly less-well compressed, but this would respect the intent of the integrator.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.