Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2022-03-15 04:33:50 +0300
committerGitHub <noreply@github.com>2022-03-15 04:33:50 +0300
commita29f4580429e52c2bff678c500c69d514087ec9e (patch)
treebe1e398587f67781f75a5d9e9594ed853fd60ac3 /core
parent6712b4f7ee71a53187b19bd3a066d2c57da7e155 (diff)
[Vue] make sure chunk assets can be removed (#18929)
* make sure chunk assets can be removed * try to fix test * another attempt at a fix
Diffstat (limited to 'core')
-rw-r--r--core/AssetManager.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/AssetManager.php b/core/AssetManager.php
index c2ad38ef96..c403969f77 100644
--- a/core/AssetManager.php
+++ b/core/AssetManager.php
@@ -279,10 +279,40 @@ class AssetManager extends Singleton
} else {
$assetsToRemove[] = $this->getMergedNonCoreJSAsset();
}
+
+ $assetFetcher = $this->getPluginUmdJScriptFetcher();
+ foreach ($assetFetcher->getChunkFiles() as $chunk) {
+ $files = $chunk->getFiles();
+
+ $foundInChunk = false;
+ foreach ($files as $file) {
+ if (strpos($file, "/$pluginName.umd.") !== false) {
+ $foundInChunk = true;
+ }
+ }
+
+ if ($foundInChunk) {
+ $outputFile = $chunk->getOutputFile();
+ $asset = $this->getMergedUIAsset($outputFile);
+ if ($asset->exists()) {
+ $assetsToRemove[] = $asset;
+ }
+ break;
+ }
+ }
}
} else {
$assetsToRemove[] = $this->getMergedCoreJSAsset();
$assetsToRemove[] = $this->getMergedNonCoreJSAsset();
+
+ $assetFetcher = $this->getPluginUmdJScriptFetcher();
+ foreach ($assetFetcher->getChunkFiles() as $chunk) {
+ $outputFile = $chunk->getOutputFile();
+ $asset = $this->getMergedUIAsset($outputFile);
+ if ($asset->exists()) {
+ $assetsToRemove[] = $asset;
+ }
+ }
}
$this->removeAssets($assetsToRemove);