From edf4ff56edc0235d2242110e6520529ea12c6dca Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 13 Apr 2023 15:43:06 +0800 Subject: [PATCH] support map file --- Asset.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Asset.php b/Asset.php index eb5c0538..bc1edc39 100644 --- a/Asset.php +++ b/Asset.php @@ -26,6 +26,7 @@ class Pman_Core_Asset extends Pman { var $types = array( 'css' => 'text/css', 'js' => 'text/javascript', + 'map' => 'application/json' ); function getAuth() @@ -44,17 +45,23 @@ class Pman_Core_Asset extends Pman { $this->jerr("invalid url"); } + $ext = $bits[0]; + if (preg_match('/\.map$/',$_REQUEST_URI)) { + $ext = 'map'; + } + $s = str_replace('/', '-', $bits[1]); + $ui = posix_getpwuid(posix_geteuid()); $ff = HTML_FlexyFramework::get(); $compile = self::getCompileDir($bits[0], '', false); - $fn = $compile . '/'. $s .'.'. $bits[0]; + $fn = $compile . '/'. $s .'.'. $ext; if (!file_exists($fn)) { - header('Content-Type: '. $this->types[$bits[0]]); + header('Content-Type: '. $this->types[$ext]); echo "// compiled file not found = $fn"; exit; -- 2.39.2