PHPackages                             netnak/minimatic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. netnak/minimatic

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

netnak/minimatic
================

v1.0.5(11mo ago)0142MITPHP

Since Jun 6Pushed 11mo agoCompare

[ Source](https://github.com/netnak/minimatic)[ Packagist](https://packagist.org/packages/netnak/minimatic)[ RSS](/packages/netnak-minimatic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Minimatic
=========

[](#minimatic)

> **Minimatic** is a Statamic addon that minifies HTML responses and/or static cached pages using [`voku/html-min`](https://github.com/voku/HtmlMin).

---

🚀 Features
----------

[](#-features)

Minimatic wraps the powerful `HtmlMin` engine and exposes its configuration through a publishable config file. You can toggle the following features:

- `doOptimizeViaHtmlDomParser()` – optimize HTML using the DOM parser
- `doRemoveComments()` – remove HTML comments
- `doSumUpWhitespace()` – collapse excess whitespace
- `doRemoveWhitespaceAroundTags()` – trim whitespace around tags
- `doOptimizeAttributes()` – optimize HTML attributes
- `doRemoveHttpPrefixFromAttributes()` – strip `http:` from attributes
- `doRemoveHttpsPrefixFromAttributes()` – strip `https:` from attributes
- `doKeepHttpAndHttpsPrefixOnExternalAttributes()` – preserve prefixes for external links
- `doMakeSameDomainsLinksRelative(['example.com'])` – make internal links relative
- `doRemoveDefaultAttributes()` – remove default attribute values
- `doRemoveDeprecatedAnchorName()` – remove deprecated anchor name attributes
- `doRemoveDeprecatedScriptCharsetAttribute()` – remove charset from `` tags
- `doRemoveDeprecatedTypeFromScriptTag()` – remove deprecated type from ``
- `doRemoveDeprecatedTypeFromStylesheetLink()` – remove `type="text/css"` from CSS links
- `doRemoveDeprecatedTypeFromStyleAndLinkTag()` – remove `type="text/css"` globally
- `doRemoveDefaultMediaTypeFromStyleAndLinkTag()` – remove `media="all"`
- `doRemoveDefaultTypeFromButton()` – remove `type="submit"` from buttons
- `doRemoveEmptyAttributes()` – strip empty attributes
- `doRemoveValueFromEmptyInput()` – remove `value=""` from empty inputs
- `doSortCssClassNames()` – sort class names for better Gzip performance
- `doSortHtmlAttributes()` – sort attributes for better Gzip performance
- `doRemoveSpacesBetweenTags()` – aggressively trim inter-tag spaces
- `doRemoveOmittedQuotes()` – omit unnecessary attribute quotes
- `doRemoveOmittedHtmlTags()` – omit redundant HTML tags

---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require netnak/minimatic
```

Then publish the config file (optional):

```
php artisan vendor:publish --tag=minimatic-config --force
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Minimatic auto-registers its own replacer at runtime.

However, if you want to manually ensure it's added as a static caching replacer, edit `config/statamic/static_caching.php`:

```
'replacers' => [
    // ...
    \Netnak\Minimatic\Replacers\MinimaticReplacer::class,
],
```

---

✅ Usage
-------

[](#-usage)

Enable minification via your `.env` file:

```
MINIFY_RESPONSE=true
MINIFY_STATIC=true
```

These values toggle options in `config/minimatic.php`:

```
'enable_response_minifier' => env('MINIFY_RESPONSE', false),
'enable_static_cache_replacer' => env('MINIFY_STATIC', false),
```

Exclude paths from minification with:

```
'ignored_paths' => ['!/*', 'api/*'],
```

---

🪪 License
---------

[](#-license)

MIT — see the [LICENSE](LICENSE) file for details.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance51

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

342d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8d9639d2634adc916f3395d3c3af3fe6038f077f5c0f4098857e6da47504efb?d=identicon)[netnak](/maintainers/netnak)

---

Top Contributors

[![netnakgraham](https://avatars.githubusercontent.com/u/20700065?v=4)](https://github.com/netnakgraham "netnakgraham (7 commits)")

### Embed Badge

![Health badge](/badges/netnak-minimatic/health.svg)

```
[![Health](https://phpackages.com/badges/netnak-minimatic/health.svg)](https://phpackages.com/packages/netnak-minimatic)
```

###  Alternatives

[statamic/ssg

Generate static sites with Statamic.

254302.4k](/packages/statamic-ssg)[statamic/seo-pro

65440.7k](/packages/statamic-seo-pro)[jacksleight/statamic-bard-texstyle

17172.5k](/packages/jacksleight-statamic-bard-texstyle)[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20116.8k](/packages/visuellverstehen-statamic-classify)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

13128.3k](/packages/withcandour-aardvark-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
