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

[FEATURE] add javascript / css minifier option #32

Closed
AndreasA opened this issue Oct 31, 2017 · 1 comment
Closed

[FEATURE] add javascript / css minifier option #32

AndreasA opened this issue Oct 31, 2017 · 1 comment

Comments

@AndreasA
Copy link

AndreasA commented Oct 31, 2017

TYPO3 by default does only a very simplistic javascript / css compression when activiating the corresponding compressJS / compressCSS options.
It would be nice to optionally add some existing third party libraries for this and use:
$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsCompressHandler']
and
$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler']

Warning: If this one is overriden, it might also be necessary to fix some "paths" in the CSS files (if it is excluded from concatination), see method \TYPO3\CMS\Core\Resource\ResourceCompressor::compressCssFile
especially:

if (!file_exists((PATH_site . $targetFile)) || $this->createGzipped && !file_exists((PATH_site . $targetFile . '.gzip'))) {
            $contents = $this->compressCssString(GeneralUtility::getUrl($filenameAbsolute));
            if (strpos($filename, $this->targetDirectory) === false) {
                $contents = $this->cssFixRelativeUrlPaths($contents, PathUtility::dirname($filename) . '/');
            }
            $this->writeFileAndCompressed($targetFile, $contents);
        }

Of course, the best option is probably to use a corresponding FE workflow but it would still be nice to have the option to compress those files without building a FE workflow.

@lochmueller
Copy link
Owner

Thanks for the feature request. sourceopt format only HTML. For CSS/JS there are other extensions in TER and also better processes (npm building) to build frontend ressources...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants