Browse Source

修复windows和unix换行符不同引起的JS、CSS打包压缩失败问题

Chirs 8 years ago
parent
commit
0a44858c89
1 changed files with 1 additions and 1 deletions
  1. 1 1
      application/admin/command/Min.php

+ 1 - 1
application/admin/command/Min.php

@@ -102,7 +102,7 @@ class Min extends Command
                 if ($res == "js")
                 if ($res == "js")
                 {
                 {
                     $content = file_get_contents($from);
                     $content = file_get_contents($from);
-                    preg_match("/require\.config\(\{[\n]+(.*?)\n\}\);/is", $content, $matches);
+                    preg_match("/require\.config\(\{[\r\n]?[\n]?+(.*?)[\r\n]?[\n]?}\);/is", $content, $matches);
                     if (!isset($matches[1]))
                     if (!isset($matches[1]))
                     {
                     {
                         $output->error("js config not found!");
                         $output->error("js config not found!");