oveleon/contao-theme-compiler-bundle
Contao Theme Compiler Bundle adds an automated workflow for compiling and managing theme assets in Contao. It helps build CSS/JS from sources, handles bundling and output paths, and streamlines deploying optimized assets for your site’s frontend.
themes/ directory structure, ThemeModel). This makes it a natural fit for Contao-based projects but non-applicable for non-Contao PHP/Laravel projects.symfony/flex) or custom integration (see Integration Approach).oveleon/contao-theme-compiler-bundle).config.yml or contao_config.php.themes/ structure.HttpKernel) may allow partial integration, but no native Laravel support exists.ThemeModel) doesn’t exist in Laravel; would require custom middleware/services to mimic behavior.| Risk Area | Contao Project Risk | Laravel Project Risk |
|---|---|---|
| Compatibility | Low | High (Symfony/Laravel gaps) |
| Configuration Overhead | Low (Contao-native) | High (custom mappings) |
| Build Tool Conflicts | Low (standalone) | Medium (Mix/Vite overlap) |
| Maintenance | Low (Contao ecosystem) | High (forking/extending) |
| Performance Impact | Low (optimized for Contao) | Unknown (untested) |
| Documentation | Unknown (assume minimal) | Critical gap |
Contao-Specific:
Laravel Adaptation:
mix-manifest.json)?spatie/laravel-theme, laravel-mix) that better fit Laravel’s ecosystem?Operational:
app.css, app.prod.css) managed?| Component | Contao Fit | Laravel Fit |
|---|---|---|
| Asset Compilation | ✅ Native (SASS/JS/CSS) | ❌ No native Laravel support |
| Theme System | ✅ Direct (themes/ directory) |
❌ Requires custom implementation |
| Configuration | ✅ Contao config.yml/contao_config.php |
❌ Symfony Bundle format mismatch |
| Dependency Mgmt | ✅ Composer (Symfony Bundle) | ✅ Composer (but may conflict) |
| Build Automation | ✅ CI/CD hooks (e.g., GitHub Actions) | ⚠️ Needs custom scripting |
composer require oveleon/contao-theme-compiler-bundle
config/config.yml:
oveleon_theme_compiler:
themes_dir: "%kernel.project_dir%/themes"
processors:
- { type: sass, from: "scss", to: "css" }
- { type: uglify, from: "js", to: "min.js" }
contao_config.php:
$GLOBALS['TL_CONFIG']['themeCompiler'] = [
'themes_dir' => TL_ROOT . '/themes',
'processors' => ['sass', 'uglify'],
];
themes/[your-theme]/assets/scss/ or assets/js/.themes/[your-theme]/assets/compiled/.Option A: Standalone Compiler Extraction (High Effort)
ThemeCompilerServiceProvider that registers asset processors.Option B: Hybrid Use Case (Low Effort)
// In Laravel, mount Contao in a subdirectory
Route::prefix('contao')->group(function () {
// Contao routes + theme compiler for admin assets
});
Option C: Replace with Laravel Alternatives
composer install).- name: Compile Contao Themes
run: php bin/contao compile:themes
| Aspect | Contao Project | Laravel Project |
|---|---|---|
| Updates | Low (Contao ecosystem) | High (forking/extending) |
| Configuration | Centralized (config.yml/contao_config.php) |
Decentralized (custom providers) |
| Debugging | Contao error logs + bundle logs | Mixed (Symfony + Laravel logs) |
| Dependency Updates | Managed by Contao | Manual (Symfony/Laravel compatibility) |
How can I help you explore Laravel packages today?