Magento 2.3.4 Advanced JS Bundling: Should a `deps` node entry within a `shim` node be copied into `deps` module in the build.js file?

magento.stackexchange https://magento.stackexchange.com/questions/315267

Question

My store's requirejs-config.js has an entry for shim node as seen in the code snippet below, that includes an entry for deps node as well. I wonder if I should copy this deps node entry to the corresponding deps node although it is originally a part of shim node.

(function() {
var config = {
    shim: {
        'Swissup_Pagespeed/js/lib/loadCSS': {
            exports: 'loadCSS'
        },
        'Swissup_Pagespeed/js/lib/cssrelpreload': {
            deps: [
                'Swissup_Pagespeed/js/lib/loadCSS'
            ]
        }
    },
    deps: [
        'jquery/jquery.cookie'
    ]
};

require.config(config);
})();
Was it helpful?

Solution

Anything that is found within a particular configuration shouldn't be copied into another node whose name resembles with the entries within another as my example shows.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top