inpsyde / composer-assets-compiler
Composer plugin that installs and compile frontend dependencies for installed Composer packages based on configuration.
Installs: 171 270
Dependents: 1
Suggesters: 0
Security: 0
Stars: 25
Watchers: 10
Forks: 1
Open Issues: 2
Type:composer-plugin
Requires
- php: >= 7.2 < 8.3
- composer-plugin-api: ^1 || ^2
- ext-json: *
Requires (Dev)
- composer/composer: ^1.10.24 || ^2.5.5
- inpsyde/php-coding-standards: ^1.0.0
- mikey179/vfsstream: ^1.6.11
- mockery/mockery: ^1.3.5 || ^1.4.4
- phpunit/phpunit: ^8.5.33 || ^9.6.7
- vimeo/psalm: >=4.30.0
- v4.x-dev
- v3.x-dev
- 3.0.1
- 3.0.0
- 3.0.0-beta.7
- 3.0.0-beta.6
- 3.0.0-beta.5
- 3.0.0-beta.4
- 3.0.0-beta.3
- 3.0.0-beta.2
- 3.0.0-beta.1
- v2.x-dev
- dev-master / 2.x-dev
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- v1.x-dev
- 1.0.1
- 1.0.0
- dev-syde-renaming
- dev-candidate/v4.x
- dev-docs/improve-ignore-lock-description
- dev-fix/src-paths-documentation
This package is auto-updated.
Last update: 2024-10-31 15:44:33 UTC
README
What is this
A Composer plugin that automatically "compiles" frontend assets (js, css, etc.) for packages installed via Composer.
A quick example
Let's assume we have a website project having a composer.json
that looks like this:
{ "name": "acme/my-project", "require": { "acme/foo": "^1", "acme/bar": "^2", "inpsyde/composer-assets-compiler": "^3" }, "extra": { "composer-asset-compiler": { "auto-run": true } } }
And then suppose that acme/foo
's composer.json
looks like this:
{ "name": "acme/foo", "extra": { "composer-asset-compiler": "gulp" } }
and acme/bar
's composer.json
looks like this:
{ "name": "acme/bar", "extra": { "composer-asset-compiler": "build" } }
When we'll install the project with Composer, the following happens:
- Composer installs the three required packages
- Immediately after that, the plugin executes and:
- the plugin looks for all installed packages (including transitive dependencies) that have a
composer-asset-compiler
configuration, finding"acme/foo"
and"acme/bar"
- moves to
"acme/foo"
installation folder, and executesnpm install && npm run gulp
- moves to
"acme/bar"
installation folder, and executesnpm install && npm run build
- the plugin looks for all installed packages (including transitive dependencies) that have a
At the end of the process, we have a project with the dependencies installed, and their assets processed.
The example above is the simplest use case, but the plugin has many possible configurations and advanced use cases.
Documentation
- Introduction
- Compiling Assets
- Script
- Dependencies
- Package Manager
- Pre-compilation
- Hash and Lock
- Execution Mode
- Configuration File
- Packages Configuration in Root
- Verbosity
- Isolated Cache
- Parallel Assets Processing
- Configuration Cheat-Sheet
- CLI Parameters
- Environment Variables
License and Copyright
This repository is a free software, and is released under the terms of the MIT license. See LICENSE for complete license.