From f78d76f0924aed14b7b6bf754f6ab603fc62668f Mon Sep 17 00:00:00 2001 From: kweij Date: Thu, 23 Jan 2020 10:57:54 +0100 Subject: [PATCH] Append bundles after `requirejs-config` and `mage/requirejs/mixins` Instead of inserting the bundles directly after `requirejs/require`, append the bundles using `add`. This causes the bundles to be loaded after 2 important files that need to be loaded before these bundles: `requirejs-config` and `mage/requirejs/mixins`. This fixes issue #57 --- Magento_BundleConfig/Block/Html/Head/Config.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Magento_BundleConfig/Block/Html/Head/Config.php b/Magento_BundleConfig/Block/Html/Head/Config.php index 3fa9236..714fae6 100644 --- a/Magento_BundleConfig/Block/Html/Head/Config.php +++ b/Magento_BundleConfig/Block/Html/Head/Config.php @@ -87,10 +87,9 @@ protected function _prepareLayout() $sharedBundleAbsPath = $staticDir . "/" . $sharedBundleRelPath; if (file_exists($sharedBundleAbsPath)) { - $assetCollection->insert( + $assetCollection->add( $sharedBundleRelPath, - $shared, - RequireJsConfig::REQUIRE_JS_FILE_NAME + $shared ); }