Skip to content

Commit 755fb70

Browse files
committed
Handle possible comment in the end of scripts
1 parent 011753b commit 755fb70

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ First you need [composer](https://getcomposer.org/) if you have not already. The
1515

1616
use NodejsPhpFallback\Uglify;
1717

18-
// Require the composer autload in your PHP file if it's not already.
18+
// Require the composer autoload in your PHP file if it's not already.
1919
// You do not need to if you use a framework with composer like Symfony, Laravel, etc.
2020
require 'vendor/autoload.php';
2121

src/NodejsPhpFallback/Uglify.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public function add($file)
3737

3838
public function getSource()
3939
{
40-
$source = trim(parent::getSource());
40+
$source = parent::getSource();
4141
foreach ($this->concat as $file) {
4242
if ($this->getMode() === 'js') {
43-
$source = rtrim($source, '; ') . ';';
43+
$source .= "\n;";
4444
}
45-
$source .= trim(file_get_contents($file));
45+
$source .= "\n" . file_get_contents($file);
4646
}
4747

4848
return $source;

0 commit comments

Comments
 (0)