This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Description
General issue
Description:
Using the current guide to setup JS bundling can lead to bundles which include domReady! in the bundle.
This results in the main bundle to be included multiple times on the page, which can cause problems with jQuery and other javascript components.
domReady! is included due to the manual writing of the bundle configuration, which doesn't filter out undesireable content (which bundlesConfigOutFile does for some reason).
Possible solutions:
Using bundlesConfigOutFile doesn't exhibit this behavior.
Additional information:
Example config
# build.js
modules: [
{
name: 'requirejs/require'
},
{
name: 'mage/bootstrap',
include: [
....
]
}
]
# requirejs-config.js
require.config({
bundles: {"requirejs/require":[...,"requirejs/domReady","domReady!",...]},
});require.config({
bundles: {"mage/bootstrap": [....]},
});
....
DOM HTML, after JS has been allowed to run
<head>
...
<script type="text/javascript" src="THEME_URL/da_DK/requirejs/require.js"></script>
...
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="domReady!" src="THEME_URL/da_DK/requirejs/require.js"></script>