PHPackages                             sympress/asset-compiler - 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. sympress/asset-compiler

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

sympress/asset-compiler
=======================

Composer plugin for compiling frontend assets in SymPress and WordPress package workspaces.

10PHP

Since Jun 13Pushed todayCompare

[ Source](https://github.com/SymPress/asset-compiler)[ Packagist](https://packagist.org/packages/sympress/asset-compiler)[ RSS](/packages/sympress-asset-compiler/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

SymPress Asset Compiler
=======================

[](#sympress-asset-compiler)

SymPress Asset Compiler is a Composer 2 plugin for building frontend assets in PHP package workspaces. It is designed for SymPress and WordPress projects that install plugins, themes, or kernel packages through Composer and want one predictable command for dependency installation, asset compilation, and build-lock handling.

The plugin keeps Composer integration small and moves the actual work into focused services for configuration, package discovery, package-manager resolution, hashing, locking, and process execution.

Requirements
------------

[](#requirements)

- PHP 8.5 or newer
- Composer 2 with plugin API 2.2 or newer
- PHP cURL and Zip extensions for precompiled archive downloads
- npm, yarn, or pnpm on the runtime PATH
- Symfony Filesystem, Finder, and Process-compatible components

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

[](#installation)

Require the package in the root project and allow the Composer plugin:

```
{
  "require": {
    "sympress/asset-compiler": "^1.0"
  },
  "config": {
    "allow-plugins": {
      "sympress/asset-compiler": true
    }
  }
}
```

For monorepos or path repositories, use the package version strategy of the root project.

Commands
--------

[](#commands)

Compile assets for discovered packages:

```
composer compile-assets
```

Print the current build hash for discovered packages:

```
composer assets-hash
```

Print package metadata for external tooling:

```
composer assets-info
```

Run the local quality gate used by this package:

```
composer qa
```

Useful compile options:

```
composer compile-assets --dry-run
composer compile-assets --dry-run --explain
composer compile-assets --packages 'vendor/package,vendor/theme-*'
composer compile-assets --ignore-lock='*'
composer compile-assets --no-install
composer compile-assets --mode production --no-dev
composer compile-assets --execution-strategy grouped --wipe-node-modules --clear-package-manager-cache
```

See [Commands](docs/commands.md) for the full command reference.

Root Configuration
------------------

[](#root-configuration)

Root configuration can be as small as enabling auto-run:

```
{
  "extra": {
    "sympress.asset-compiler": {
      "auto-run": true,
      "package-manager": "yarn"
    }
  }
}
```

When no package build config is present, packages with a `package.json` `build` script are compiled with dependency installation enabled. Source and config files used for build hashes are discovered automatically from common frontend files and directories. The root `package-manager` is a project preference: package-level config, `package.json` `packageManager`, and unambiguous lock files still win per package. If nothing can be resolved, npm is the final fallback because it ships with Node.js. Invalid package-manager names fail early.

See [Configuration](docs/configuration.md) for all supported keys and mode handling.

Package Configuration
---------------------

[](#package-configuration)

Individual packages can opt in or override defaults through their own Composer `extra` section. The short form is enough for most packages:

```
{
  "extra": {
    "sympress.asset-compiler": "build"
  }
}
```

Use the object form only when a package needs custom behavior:

```
{
  "extra": {
    "sympress": {
      "asset-compiler": {
        "script": ["build", "build:admin"],
        "dependencies": "install",
        "package-manager": "npm",
        "timeout": 900,
        "src-paths": ["resources", "webpack.config.js"]
      }
    }
  }
}
```

Packages that need a different package manager can also declare it in `package.json`, for example `"packageManager": "npm@10.9.0"`. When a package has conflicting lock files, the root preference is used unless package config or `packageManager` makes the choice explicit. Without a root preference, npm is used.

Packages may also move their build config into `asset-compiler.json` or `assets-compiler.json` in the package root when the root project explicitly enables package config files. The file contains the same object that would otherwise live under Composer `extra.sympress.asset-compiler`.

Precompiled Assets
------------------

[](#precompiled-assets)

Packages can restore ZIP archives instead of building locally. This is useful for production installs, CI artifacts, and release packages:

```
{
  "precompiled": {
    "adapter": "github-release",
    "source": "assets-${version}.zip",
    "target": "assets",
    "checksum": "sha256:",
    "config": {
      "repository": "vendor/repository",
      "tag": "${version}"
    }
  }
}
```

Supported adapters are `archive`, `zip`, `github-release`, `gh-release-zip`, `github-artifact`, and `gh-action-artifact`. If precompiled assets are unavailable, the compiler falls back to the normal build. Security failures such as checksum mismatches, unsafe targets, unsafe ZIP entries, HTTP sources, or missing production checksums fail the run. Downloads use HTTPS-only requests and redirects, bounded timeouts, archive size limits, and ZIP extraction limits. GitHub tokens are only sent to trusted GitHub API/download hosts and are not forwarded to arbitrary redirect targets.

Build Locks
-----------

[](#build-locks)

Every successful package build writes a package-local `.sympress_asset_compiler.lock` file. The lock stores the current build hash, so unchanged packages can be skipped on future runs. The hash includes the resolved package manager and toolchain versions, source inputs, build config, environment, and precompiled asset configuration.

Use `--ignore-lock='*'` to rebuild everything or `--ignore-lock='vendor/package-*'` to rebuild selected package patterns.

Documentation
-------------

[](#documentation)

- [Commands](docs/commands.md)
- [Configuration](docs/configuration.md)
- [Architecture](docs/architecture.md)
- [Migration](docs/migration.md)

License
-------

[](#license)

This package is licensed under GPL-2.0-or-later. See [LICENSE](LICENSE).

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/53712359?v=4)[Brian Schäffner](/maintainers/brianvarskonst)[@brianvarskonst](https://github.com/brianvarskonst)

---

Tags

assetscomposercomposer-pluginencorefrontendfrontend-developmentnpmpnpmsymfonywebpackwordpressyarn

### Embed Badge

![Health badge](/badges/sympress-asset-compiler/health.svg)

```
[![Health](https://phpackages.com/badges/sympress-asset-compiler/health.svg)](https://phpackages.com/packages/sympress-asset-compiler)
```

###  Alternatives

[pragmatic-modules/magento2-module-system-configuration-toolkit

System Configuration Toolkit is a Magento 2 module that shows sort order of system configuration's tabs, sections, groups, and fields. It also helps you to see full field paths, so no more looking for those.

3212.0k](/packages/pragmatic-modules-magento2-module-system-configuration-toolkit)[dfridrich/czech-data-box

Knihovna pro komunikaci s datovou schránkou v PHP.

2910.6k1](/packages/dfridrich-czech-data-box)[mohammad-mahdy/yii2-jdate

Jalali date &amp; time.

148.5k5](/packages/mohammad-mahdy-yii2-jdate)

PHPackages © 2026

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