- Does oveleon/contao-theme-compiler-bundle work with Laravel, or is it strictly for Contao CMS?
- This bundle is designed exclusively for Contao CMS and integrates with its theme system (e.g., `themes/` directory). While it uses Symfony Bundle architecture, Laravel projects would require custom adaptation or a hybrid approach, such as extracting its compiler logic for standalone use. For Laravel, consider alternatives like Laravel Mix or Vite for asset pipelines.
- What Contao versions does this bundle support? Will it work with Contao 4.13+?
- The bundle’s documentation or repository (if available) should specify supported Contao versions. As of the provided context, it’s unclear, but Contao 4.x compatibility is implied. Always check the package’s `composer.json` or Contao’s changelog for version-specific notes. If unsure, test with your Contao version in a staging environment first.
- How do I configure the bundle to compile SASS files into CSS for my Contao theme?
- Configure the bundle via `config/config.yml` under the `oveleon_theme_compiler` key. Define processors like this: `processors: [{ type: sass, from: 'scss', to: 'css' }]`. Ensure your SASS files are placed in the correct `themes/` subdirectory (e.g., `themes/mytheme/scss/`). The bundle will auto-compile them during theme activation or manual triggers.
- Can I use this bundle to minify JavaScript files in Contao?
- Yes, the bundle supports JavaScript processing. Add a processor to your configuration like this: `processors: [{ type: uglify, from: 'js', to: 'min.js' }]`. Place your JS files in the theme’s directory (e.g., `themes/mytheme/js/`), and the bundle will generate minified versions during compilation. Verify supported processors in the bundle’s docs or source code.
- What happens if compilation fails during deployment? Will my Contao site break?
- The bundle’s failure mode depends on its implementation, but typically, compilation errors would prevent theme activation or asset generation. To mitigate risks, test builds locally before deployment and use environment checks (e.g., `APP_ENV=production`) to skip compilation if needed. Monitor logs for errors and implement fallback mechanisms, like serving uncompiled assets in emergencies.
- Does the bundle support incremental builds (only recompiling changed files)?
- The context doesn’t specify incremental build support, but modern asset compilers often include this feature. Check the bundle’s source code for file-watching or timestamp-based logic. If missing, you may need to extend it or use a wrapper script (e.g., Laravel’s `mix watch`) to achieve incremental builds. Always verify with the latest version.
- How do I handle environment-specific assets (e.g., debug vs. production CSS/JS)?
- The bundle likely supports environment-specific configurations via Symfony’s parameter system or Contao’s `contao_config.php`. Define separate processor rules for each environment (e.g., `debug: true` for local builds) or use Contao’s `TL_CONFIG` to toggle features. For advanced setups, consider post-compilation scripts to rename or symlink files (e.g., `app.css` → `app.prod.css`).
- Are there predefined asset processors (e.g., PostCSS, Terser) beyond SASS and JS minification?
- The context mentions basic SASS and JS (uglify) support, but no PostCSS or Terser is confirmed. Check the bundle’s `Processor` classes or documentation for extensibility. If missing, you can create custom processors by implementing the bundle’s interface or wrapping third-party tools (e.g., `league/glide` for images) into the pipeline.
- What caching strategy does the bundle use for compiled assets? Can I use Redis?
- The caching strategy isn’t detailed, but typical implementations use file-based caching (e.g., storing compiled assets in `themes/mytheme/compiled/`). For Redis or other caches, you’d need to extend the bundle’s `Cache` class or configure a custom storage adapter. Verify if the bundle supports Symfony’s `Cache` component for easier integration with Redis or APCu.
- What are the alternatives to this bundle for Contao, or Laravel-specific asset management?
- For Contao, alternatives include manual tooling (e.g., Gulp/Webpack) or Contao’s built-in `ThemeModel` hooks for asset handling. For Laravel, use Laravel Mix, Vite, or Webpack for asset pipelines. If you need theme modularity in Laravel, explore `spatie/laravel-theme` or custom service providers. This bundle’s uniqueness lies in its Contao-native integration, so alternatives may lack Contao’s theme system compatibility.