EXT:min - Minifier for TYPO3 CMS 

Classification

min

Version

2.1

Language

en

Description

Extends TYPO3's compressor for JS and CSS with minifier. This may save you up to 60% of default compressed file size. Also compresses HTML output of TYPO3. Full composer support.

Keywords

TYPO3 CMS, minifier, minify, compress, optimize, output

Copyright

2016-2023

Author

Armin Vieweg

Email

info@v.ieweg.de

License

This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml

Rendered

Tue, 10 Mar 2026 13:43:40 +0000

The content of this document is related to TYPO3, a GNU/GPL CMS/Framework available from www.typo3.org.

Table of Contents

Welcome 

The minifier extension for TYPO3 CMS (EXT:min) reduces the output of TYPO3 in several ways:

  • it minifies CSS and JS assets (TYPO3 "just" gzip them), which may safe you additional 60% of file size
  • and it also compresses the HTML output for every page, to one single line (formerly known as "tinysource")

EXT:min uses the great matthiasmullie/minify package.

Features 

  • Additional minification of JS and CSS assets (including files in AssetCollector)
  • HTML output compression
  • Highly configurable
  • Full composer support
  • Alternative TER version (with minify library included)

Roadmap / Missing Features 

  • Provide unit tests, to ensure correct minification results

Installation 

You can install EXT:min like any other TYPO3 extension.

Requirements 

  • PHP 7.4 or higher
  • TYPO3 10.4 or 11.5

Setup 

Since version 2.0 it is required to manually include the TypoScript configuration, of EXT:min.

You can do this in TypoScript using the @import function:

@import 'EXT:min/Configuration/TypoScript/setup.typoscript'
Copied!

or define it as static include in the template itself:

Setup of EXT:min in TypoScript template's static includes

Upgrade notice 

When you upgrade EXT:min from version 1.0 to 2.0, you need to update your TypoScript configuration!

  • The protectCode moved from head and body section, to root level. Any old occurrences are being ignored (which may break, protected code)
  • The following options has been removed, those functionalities are enabled by default, when tinysource is enabled:
- stripTabs
  • stripNewLines
  • stripDoubleSpaces
  • stripTwoLinesToOne
  • The function stripSpacesBetweenTags has been removed entirely

Configuration 

By default, when you've applied the EXT:min TypoScript configuration, all minification features are enabled and pre-configured to get best compression results.

Debugging 

Also, there is a TypoScript condition included which takes effect, when

  • you are logged-in to the TYPO3 backend and
  • added the query parameter ?debug=1

This disables all features of EXT:min and also the compression and concatenation features of the core itself.

Settings 

The following chapters, explain the available options you have, using the default configuration as example.

Asset compression (CSS/JS) 

To enable the asset compression of TYPO3, as well as of EXT:min just add this to your TypoScript.

config {
	compressCss = 1
	concatenateCss = 1
	compressJs = 1
	concatenateJs = 1
}
Copied!

AssetCollector compression 

Since version 2.1 assets added by the AssetCollector are also minified (but not concatenated). You can enable/disable the compression of AssetCollector assets. By default it is enabled:

plugin.tx_min.assetCollector {
	compressCss = 1
	compressInlineCss = 1
	compressJs = 1
	compressInlineJs = 1
}
Copied!

HTML source compression 

Because of historical reasons, the configuration for HTML compression is located in plugin.tx_min.tinysource:

plugin.tx_min.tinysource {
	enable = 1
	body {
		stripComments = 1
		preventStripOfSearchComment = 1
		removeTypeInScriptTags = 1
	}
	protectCode {
		10 = /(<textarea.*?>.*?<\/textarea>)/is
		20 = /(<pre.*?>.*?<\/pre>)/is
	}
	oneLineMode = 1
}
Copied!
Property Type Default
enable bool 1
body.stripComments_ bool 1
body.preventStripOfSearchComment_ bool 1
body.removeTypeInScriptTags_ bool 1
protectCode array see below
oneLineMode bool 1

enable 

Property
enable
Data type
bool
Default
1
Description
Enables or disables the HTML source compression.

body.stripComments 

Property
body.stripComments
Data type
bool
Default
1
Description
Removes all HTML comments from HTML body, when enabled.

body.preventStripOfSearchComment 

Property
body.preventStripOfSearchComment
Data type
bool
Default
1
Description
Prevents <!--TYPO3SEARCH_begin--> and <!--TYPO3SEARCH_end--> from being removed,

when stripComments setting is enabled.

body.removeTypeInScriptTags 

Property
body.removeTypeInScriptTags
Data type
bool
Default
1
Description
Removes type attribute from <script> tags, within body.

protectCode 

Property
protectCode
Data type
array

Default .. code-block:: typoscript

10 = /(<textarea.?>.?</textarea>)/is 20 = /(<pre.?>.?</pre>)/is

Description
Allows to protect whitespace sensitive code from being touched, by using regular expressions. By default textarea and pre tags are protected.

oneLineMode 

Property
oneLineMode
Data type
bool
Default
1
Description
By default, TYPO3 outputs the sections (head, body) of HTML pages to separated lines ("\n") in source. With this option enabled, all line-breaks (except for protected code) will be removed, in HTML source.

Support 

Issues 

In case you have problems, questions, feature requests or improvements for EXT:min, check out the issues section on Github.

Contribute 

If you are a developer and you want to submit improvements as code, you can fork this repo and make a pull request to master branch.

Thanks!

Versions 

2.1.0 

  • [DOCS] Update Documentation
  • [TASK] Do not minify missing assets, which have been added to AssetCollector
  • [BUGFIX] Fix relative URLs in compressed CSS files
  • [TASK] Update "matthiasmullie/minify" package
  • [TASK] Update copyright
  • [FEATURE] Implement css/js compression for AssetRenderer
  • [DOCS] Fix link format to issue tracker in Support.rst

2.0.3 

  • [BUGFIX] Fix php 8 required syntax in ext_localconf.php
  • [BUGFIX] Fix typoscript condition checking for ?debug=1 query param
  • [DOCS] Fix link format to issue tracker in Support.rst

2.0.2 

  • [BUGFIX] Avoid undefined array key warnings in PHP8 (2)
  • [BUGFIX] Avoid undefined array key warnings in PHP8 (contributed by Chris Müller)

2.0.1 

  • [BUGFIX] Do not output "#!#protected_XXX#!#" placeholder
  • [DOCS] Update README contents
  • [DOCS] Update project title

2.0.0 

  • [DOCS] Provide documentation
  • [TASK] Update Copyrights
  • [TASK] Remove tinysource options and enabled functionality by default
  • [TASK] Provide ?debug=1 config and enable compression flags
  • [TASK] Do not include typoscript configuration on system level
  • [TASK] Move TER dependencies to dedicated directory and provide DDEV command to update
  • [TASK] Define TYPO3 compatibility (v10 and v11)
  • [TASK] Remove bitbucket pipelines config
  • [DOCS] Provide roadmap for Version 2.0 of t3/min

1.9.0 

  • [BUGFIX] Remove unwanted stuff from composer.lock
  • [TASK] Replace PATH_site with Environment::getPublicPath()
  • [FEATURE] Support TYPO3 10.4 LTS

1.8.0 

  • [TASK] Update copyrights
  • [TASK] Update matthiasmullie/minify library
  • [BUGFIX] Always append ";" for inline javascript compression
  • [FEATURE] Add option removeTypeInScriptTags

1.7.0 

  • [TASK] Improve code protection & one line mode

1.6.0 

  • [FEATURE] TYPO3 9.5 LTS compatibility fix

1.5.0 

  • [TASK] Add new extension icon
  • [TASK] Some improvements in README and composer.json
  • [!!!][TASK] Update vendor name in namespace
  • [TASK] Update copyright
  • [TASK] Update matthiasmullie/minify from 1.3.55 to 1.3.60
  • [BUGFIX] Fix wrong written constant TYPO3_SITE

1.4.0 

  • [BUGFIX][!] Replace new lines correctly
  • [TASK] Update Vagrantfile

1.3.2 

  • [BUGFIX] Remove concat string in ext_emconf

1.3.1 

  • [TASK] Code style fixes
  • [TASK] Fix whitespace in README
  • [TASK] Add Bitbucket Pipelines configuration
  • [BUGFIX] Fix multiple occurrences of protected code
  • [TASK] Add Vagrantfile for developmen purposes

1.3.0 

  • [TASK] Update php syntax (no PHP 5.3 support required)
  • [TASK] Update matthiasmullie/minify dependency
  • [TASK] Remove ext_tables and set defaults to full compression
  • [TASK] Do not hardcode path of compressed resources

1.2.5 

Compatibility release

Without composer.json and with TYPO3 6.2 & PHP 5.3 support. This version is based on 1.3.0, but should just be used for TYPO3 6.2, to avoid problems with PackageStates.php processing.

1.2.0 

  • [FEATURE] Protect <textarea> and <pre> html tags
  • [BUGFIX] remove deprecation log from copied method (contributed by JKummer)
  • [TASK] Deprecated callback method compressCssPregCallback (contributed by JKummer)
  • [BUGFIX] Missing compressor folder in target path for minify files (contributed by JKummer)

1.1.1 

  • [TASK] Remove version from composer.json
  • [TASK] Add "tinysource" to conflicts section in emconf
  • [TASK] Add "html compression" as feature to description of extension

1.1.0 

  • [TASK] Remove "Custom Replacement" feature from Tinysource
  • [TASK] Add tinysource feature to README.rst
  • [TASK] Replace EXT:tinysource and package arminvieweg/tinysource
  • [FEATURE] Merge EXT:tinysource to EXT:min
  • [BUGFIX] Remove two regular expressions from css compression

1.0.0 

  • [TASK] Add extension icon
  • [TASK] Always write compressor/ and apply TYPO3's default css compression
  • [TASK] Just minify files in frontend
  • [FEATURE] Also minify cssInline, jsInline and jsFooterInline
  • [TASK] Refactor minifier bridge
  • [TASK] Append -min instead of .min
  • [TASK] Update README
  • [TASK] Disable import CSS
  • [TASK] Add content to README
  • [INITIAL] Kickstart new extension "min"