From a0623475b3b0b7a9be69dbdc8e0a8a09b7263dc6 Mon Sep 17 00:00:00 2001 From: vedro-compota Date: Tue, 22 Jan 2019 19:52:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D1=82=D0=BE=20=D0=BD=D0=B5=20=D1=8F=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20=D0=BB=D0=B8=20js-=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=20source=20map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ src/SimpleAssetManager.php | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 86b0380..8c4f64f 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,10 @@ Css: -- Как видно, `SimpleAssetManager` может выводить все зарегистрированные JS и CSS в нужном порядке. (As you can see `SimpleAssetManager` can print JS or Css like HTML resource tags) +### javascript source maps + +Вы можете добавлять source map в массив js. +(You can add source map in `public $js ` array for publishing.) ## Связанные пакеты (Other related packages) diff --git a/src/SimpleAssetManager.php b/src/SimpleAssetManager.php index 0ca712a..92a226c 100644 --- a/src/SimpleAssetManager.php +++ b/src/SimpleAssetManager.php @@ -3,6 +3,7 @@ namespace ItForFree\SimpleAsset; use ItForFree\rusphp\File\Path; +use ItForFree\rusphp\PHP\Str\StrCommon; /** * Менеджер ассетов (в т.ч. управляет зависимостями) @@ -98,13 +99,20 @@ public static function getJsHtml() $html = ''; foreach (static::$assets as $Asset) { foreach ($Asset->publishedPaths['js'] as $filePath) { - $html .= "\n"; + } } } return $html; } + protected function isSourceMapFile($path) + { + return StrCommon::isEndWith($path, '.map'); + } + /** * Вернёт HTML код для Сss * @return string