Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow requireCompressMark option. #170

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions deployment.sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ after[] = local: git reset HEAD --hard ; reverts all changes in working direct
; files to preprocess (defaults to none)
preprocess = *.js *.css

; compression mark (default to yes)
requireCompressMark = no

; file which contains hashes of all uploaded files (defaults to .htdeployment)
deploymentFile = .deployment

Expand Down
3 changes: 3 additions & 0 deletions src/Deployment/CliRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ private function createDeployer(array $config): Deployer
? ['*.js', '*.css']
: self::toArray($config['preprocess']); // intentionally ==
$preprocessor = new Preprocessor($this->logger);
if (isset($config['requireCompressMark'])) {
$preprocessor->requireCompressMark = $config['requireCompressMark'] !== 'no';
}
$deployment->addFilter('js', [$preprocessor, 'expandApacheImports']);
$deployment->addFilter('js', [$preprocessor, 'compressJs'], true);
$deployment->addFilter('css', [$preprocessor, 'expandApacheImports']);
Expand Down
Loading