Skip to content

Commit 89d5b6e

Browse files
committed
Runtime: Restrict minifying to *.php files
1 parent 7a762c8 commit 89d5b6e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Command/Compile.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ protected function addFile(string $file)
112112
$fullpath = $this->fullpath($file);
113113

114114
$this->info('+ ' . $file, 'grey');
115-
$this->builder->addFile($fullpath, $file);
115+
116+
// Only minify pure PHP source files, other files such as
117+
// code templates for instance, should be left as-is
118+
$minify = (pathinfo($file, PATHINFO_EXTENSION) === 'php');
119+
120+
$this->builder->addFile($fullpath, $file, $minify);
116121
}
117122

118123
/**

0 commit comments

Comments
 (0)