Allows you to add CoffeeScript, SCSS, and LESS as standard requirements and automatically compiles on page load.
This package is auto-updated.
Last update: 2023-01-29 02:23:31 UTC
This module allows the direct inclusion of uncompiled meta-language dependencies such as CoffeeScript, LESS, and SASS into your project and compiles them at runtime.
Just require the dependency in your controller, and use it just like Requirements.
By default, files are only compiled in "test" and "dev" environments. To limit compiling to specific environments:
<?php MetaLanguages::set_compile_environments(array( 'dev', 'localhost:8888', 'staging.example.com' ));
Requirement_coffeescript: compiled_path: mysite/coffee Requirement_scss: compiled_path: mysite/sass
The /usr/local/bin path is forced into the shell environment by default, but if you need more control over it:
Requirement_coffeescript: coffee_exec: /my/path/to/coffee
Compiling doesn't happen unless the "last edited" time difference between the raw and uncompiled file is greater than a specific number of seconds (defaults to 5)
MetaLanguages: modification_tolerance: 10;
Compiling SASS is exceedingly difficult from within PHP because it is a Ruby gem, so environmental issues are numerous. This module uses a thirdparty PHP compiler for SASS, which is known to have some bugs.