[TYPO3-english] Minification for JavaScript files

Chris Müller mueller at cyperfection.de
Mon Aug 27 13:06:25 CEST 2012


Hi Steffen,

okay, so I will have to use scriptmerger again and have to drop the use 
of the core feature.

Regards,
Chris.

Am 27.08.2012 08:31, schrieb Steffen Gebert:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Chris,
>
> yes, that's what I said. No minification for JS.
>
> That's the whole code. No minification:
>
>> public function compressJsFile($filename) { // generate the unique
>> name of the file $filenameAbsolute =
>> \TYPO3\CMS\Core\Utility\GeneralUtility::resolveBackPath($this->rootPath
>> . $this->getFilenameFromMainDir($filename)); $unique =
>> ($filenameAbsolute . filemtime($filenameAbsolute)) .
>> filesize($filenameAbsolute); $pathinfo = pathinfo($filename);
>> $targetFile = ((($this->targetDirectory . $pathinfo['filename']) .
>> '-') . md5($unique)) . '.js'; // only create it, if it doesn't
>> exist, yet if (!file_exists((PATH_site . $targetFile)) ||
>> $this->createGzipped && !file_exists(((PATH_site . $targetFile) .
>> '.gzip'))) { $contents =
>> \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($filenameAbsolute);
>> $this->writeFileAndCompressed($targetFile, $contents); } return
>> $this->relativePath . $this->returnFileReference($targetFile); }
>
>
>
> Kind regards
> Steffen
>
> - --
> Steffen Gebert
> TYPO3 v4 Core Team Member
> TYPO3 Server Administration Team Member
>
> TYPO3 .... inspiring people to share!
> Get involved: http://typo3.org
>
> I work for TYPO3 solely in my spare time. If you think that
> my work helps you running your business, you are invited to
> send me a donation via PayPal to this email address. Thanks
>
> Am 8/27/12 8:19 AM, schrieb Chris Müller:
>> Hi Steffen,
>>
>> but there is a method "t3lib_div::minifyJavaScript() which does
>> the minification. Also this function is called in
>> t3lib_PageRenderer::doCompressJavaScript(). So this should work, or
>> I am wrong?
>>
>> I'm having the same problem, no minification occurs. But the
>> documentation of config.compressJs doesn't mention the minifying,
>> just the gzip'ing. So it seems that this should not work.
>>
>> There is a ticket on forge: http://forge.typo3.org/issues/33370
>> which describes this issue.
>>
>> Regards, Chris.
>>
>> Am 25.08.2012 11:33, schrieb Steffen Gebert:
>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>
>>> It's very error prone and there are no good on-the-fly PHP
>>> compressors available, which have a fitting license.
>>>
>>> That's at least my knowledge and that's why we didn't try to
>>> implement it.
>>>
>>> Kind regards Steffen
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJQOxQ2AAoJEIskG/rSlyw4oDYIAKP1vrbbc3IvPfotj2XwLiJf
> yHaB6wJEhzEZ9Jqgk20HFdE2xYf1swZgv8/DyWhEEaMoXTF/gp1fqZHBXQ1AKceO
> 5svBALc/WqfT6l+IquacLkbD0cQ3fGT6OS9CbC9LpJ+QASSwKHj7snCSwH+PGPpS
> DoHBJIcYLbdMGTbu5vRvdRIj02bPn5rrLtFCohnqvISuW6MdveRyTRQK8RXBcc2r
> f1rrM5I39Dz29WsWQ/GcA8FbXT2LzvEvtDAL/6X+/5O0nQp4yO4HmME7jS0YdpGg
> wPiA52JZx/Aot4HcH4vjurfvhxyymo8oSoJC2DEV/N4COtnWcRgb5TKgn1NivFo=
> =8Qwt
> -----END PGP SIGNATURE-----
>



More information about the TYPO3-english mailing list