PHPackages                             mindkomm/theme-lib-mix - 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. mindkomm/theme-lib-mix

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

mindkomm/theme-lib-mix
======================

Laravel Mix functions for WordPress projects

1.2.0(4y ago)3544.8k↓26.9%7[1 issues](https://github.com/mindkomm/theme-lib-mix/issues)1MITPHPPHP &gt;=7.0.0

Since Feb 13Pushed 2y ago3 watchersCompare

[ Source](https://github.com/mindkomm/theme-lib-mix)[ Packagist](https://packagist.org/packages/mindkomm/theme-lib-mix)[ RSS](/packages/mindkomm-theme-lib-mix/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (6)Used By (1)

Mix
===

[](#mix)

A [Laravel Mix](https://github.com/JeffreyWay/laravel-mix) function for WordPress themes.

The `mix()` function is useful if you want to enable **cache busting** for your theme asset files (CSS, JavaScript, images, icon sprites). Laravel Mix allows you to create a `mix-manifest.json` file, which might look like this:

```
{
    "/css/styles.css": "/css/styles.css?id=6ed48b0b831e80bd7549",
    "/js/scripts.js": "/js/scripts.js?id=1bdd07b944e933aa88aa",
}
```

The ID parameter is a hash of the file contents that changes every time that you make a change to a file. The `mix()`, `mix_child()` and `mix_any()` functions provided in this package allow you to use these hashed URLs for enqueueing your assets in your WordPress theme.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require mindkomm/theme-lib-mix
```

Usage
-----

[](#usage)

The `mix()` function assumes that you have a `mix-manifest.json` (generated by the [version function of Laravel Mix](https://github.com/JeffreyWay/laravel-mix/blob/master/docs/versioning.md)) in the `build` folder of your theme.

```
add_action( 'wp_enqueue_scripts', function() {
    wp_enqueue_style(
        'styles',
        mix( 'build/css/styles.css' )
    );
} );
```

If the mix function can’t find your asset file in the manifest file, it will return the asset URL through [`get_theme_file_uri`](https://developer.wordpress.org/reference/functions/get_theme_file_uri/) as a fallback.

Functions
---------

[](#functions)

NameReturn TypeSummary/Returns[mix()](#mix)`string`Gets the path to a versioned Mix file in a theme.

*Returns:* The versioned file URL.[mix\_child()](#mix_child)`string`Gets the path to a versioned Mix file in a **child theme**.

*Returns:* The versioned file URL.[mix\_any()](#mix_any)`string`Gets the path to a versioned Mix file outside of your theme folders.

*Returns:* The versioned file URL.### mix()

[](#mix-1)

Gets the path to a versioned Mix file in a theme.

Use this function if you want to load theme dependencies. This function will cache the contents of the manifest files for you.

- If you want to use mix in a child theme, use `mix_child()`.
- If you want to use mix outside of your theme folder, you can use `mix_any()`.

**since** 1.0.0

`mix( string $path, array $args = [] )`

**Returns:** `string` The versioned file URL.

NameTypeDescription$path`string`The relative path to the file.$args`array`Optional. An array of arguments for the function.- *(bool)* **$is\_child** – Whether to check the child directory first. Default `false`.
- *(string)* **$manifest\_directory** – Custom relative path to manifest directory. Default `build`.

```
add_action( 'wp_enqueue_scripts', function() {
    wp_enqueue_style(
        'styles',
        mix( 'build/css/styles.css' )
    );
} );
```

### mix\_child()

[](#mix_child)

Gets the path to a versioned Mix file in a child theme.

Similar to [`mix()`](#mix), but tries to load a file from the child theme first.

**since** 1.2.0

`mix_child( string $path, array $args = [] )`

```
add_action( 'wp_enqueue_scripts', function() {
	wp_enqueue_style(
		'theme-styles-child',
		mix_child( 'build/css/styles-child.css' ),
		[],
		null
	);
} );
```

### mix\_any()

[](#mix_any)

Gets the path to a versioned Mix file outside of your theme folders.

The difference to the `mix()` function is that for this function, you need to provide the absolute paths to the file and the manifest directory. The benefit is that it’s more versatile and that you can use it for functionality that might not live in a theme, but in a plugin, vendor packages or in a symlinked package.

**since** 1.1.0

`mix_any( string $path, string $manifest_directory, string $manifest_name = mix-manifest.json )`

**Returns:** `string` The versioned file URL.

NameTypeDescription$path`string`The full path to the file.$manifest\_directory`string`The full path to the manifest directory.$manifest\_name`string`Optional. The name of the manifest file in `$manifest_directory`. Default `mix-manifest.json`.---

Support
-------

[](#support)

This is a library that we use at MIND to develop WordPress themes. You’re free to use it, but currently, we don’t provide any support.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~503 days

Total

4

Last Release

1505d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2084481?v=4)[Lukas Gächter](/maintainers/gchtr)[@gchtr](https://github.com/gchtr)

---

Top Contributors

[![gchtr](https://avatars.githubusercontent.com/u/2084481?v=4)](https://github.com/gchtr "gchtr (9 commits)")

---

Tags

laravel-mixtheme-developmentwordpresswordpress-theme

### Embed Badge

![Health badge](/badges/mindkomm-theme-lib-mix/health.svg)

```
[![Health](https://phpackages.com/badges/mindkomm-theme-lib-mix/health.svg)](https://phpackages.com/packages/mindkomm-theme-lib-mix)
```

PHPackages © 2026

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