Skip to content

Commit 613cb23

Browse files
committed
fix source maps detection in browser
1 parent 52da650 commit 613cb23

File tree

1 file changed

+8
-2
lines changed
  • lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less

1 file changed

+8
-2
lines changed

lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Framework\Css\PreProcessor\Adapter\Less;
77

8+
use Magento\Framework\App\Filesystem\DirectoryList;
89
use Magento\Framework\App\State;
910
use Magento\Framework\Css\PreProcessor\File\Temporary;
1011
use Magento\Framework\Phrase;
@@ -40,6 +41,7 @@ class Processor implements ContentProcessorInterface
4041
* @var Temporary
4142
*/
4243
private $temporaryFile;
44+
private DirectoryList $directoryList;
4345

4446
/**
4547
* Constructor
@@ -53,12 +55,14 @@ public function __construct(
5355
LoggerInterface $logger,
5456
State $appState,
5557
Source $assetSource,
56-
Temporary $temporaryFile
58+
Temporary $temporaryFile,
59+
DirectoryList $directoryList
5760
) {
5861
$this->logger = $logger;
5962
$this->appState = $appState;
6063
$this->assetSource = $assetSource;
6164
$this->temporaryFile = $temporaryFile;
65+
$this->directoryList = $directoryList;
6266
}
6367

6468
/**
@@ -73,7 +77,9 @@ public function processContent(File $asset)
7377
[
7478
'relativeUrls' => false,
7579
'compress' => $mode !== State::MODE_DEVELOPER,
76-
'sourceMap' => $mode === State::MODE_DEVELOPER
80+
'sourceMap' => $mode === State::MODE_DEVELOPER,
81+
'sourceMapRootpath' => '/',
82+
'sourceMapBasepath' => $this->directoryList->getPath(DirectoryList::TEMPLATE_MINIFICATION_DIR) . '/pub/'
7783
]
7884
);
7985

0 commit comments

Comments
 (0)