コード例 #1
0
ファイル: CSS.php プロジェクト: eusonlito/laravel-packer
 /**
  * @param  string $file
  * @param  string $public
  * @return string
  */
 public function pack($file, $public)
 {
     if (!Packer::isRemote($file) && !is_file($file)) {
         return sprintf('/* File %s not exists */', $file);
     }
     $contents = file_get_contents($file);
     if ($this->settings['minify']) {
         $contents = (new CSSmin())->run($contents);
     }
     return preg_replace('/(url\\([\'"]?)/', '$1' . $this->settings['asset'] . dirname($public) . '/', $contents);
 }
コード例 #2
0
ファイル: JS.php プロジェクト: eusonlito/laravel-packer
 /**
  * @param  string $file
  * @param  string $public
  * @return string
  */
 public function pack($file, $public)
 {
     if (!Packer::isRemote($file) && !is_file($file)) {
         return sprintf('/* File %s not exists */', $file);
     }
     $contents = file_get_contents($file);
     if ($this->settings['minify']) {
         $contents = JSMin::minify($contents);
     }
     return ';' . $contents;
 }