Skip to content

Commit dcd8bcb

Browse files
author
Yevhen Miroshnychenko
authored
Merge pull request #2151 from magento-thunder/MAGETWO-84507
Fixed issues: - MAGETWO-84507: JS merging fails when JS bundling is enabled and bundle folder contains any other files
2 parents 87e41af + b049c5c commit dcd8bcb

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
@@ -183,6 +183,9 @@ public function createBundleJsPool()
183183
}
184184

185185
foreach ($libDir->read($bundleDir) as $bundleFile) {
186+
if (pathinfo($bundleFile, PATHINFO_EXTENSION) !== 'js') {
187+
continue;
188+
}
186189
$relPath = $libDir->getRelativePath($bundleFile);
187190
$bundles[] = $this->assetRepo->createArbitrary($relPath, '');
188191
}

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

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

0 commit comments

Comments
 (0)