Skip to content

Commit df09179

Browse files
author
Yevhen Miroshnychenko
authored
Merge pull request #2160 from magento-thunder/MAGETWO-88336
Fixed issues: - MAGETWO-88336: [Backport] JS merging fails when JS bundling is enabled and bundle folder contains any other files
2 parents a06e049 + 49f98cf commit df09179

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/RequireJs/Model/FileManager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ public function createBundleJsPool()
164164
}
165165

166166
foreach ($libDir->read($bundleDir) as $bundleFile) {
167+
if (pathinfo($bundleFile, PATHINFO_EXTENSION) !== 'js') {
168+
continue;
169+
}
167170
$relPath = $libDir->getRelativePath($bundleFile);
168171
$bundles[] = $this->assetRepo->createArbitrary($relPath, '');
169172
}

app/code/Magento/RequireJs/Test/Unit/Model/FileManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function testCreateBundleJsPool()
150150
->expects($this->once())
151151
->method('read')
152152
->with('path/to/bundle/dir/js/bundle')
153-
->willReturn(['bundle1.js', 'bundle2.js']);
153+
->willReturn(['bundle1.js', 'bundle2.js', 'some_file.not_js']);
154154
$dirRead
155155
->expects($this->exactly(2))
156156
->method('getRelativePath')

0 commit comments

Comments
 (0)