SwissUpLabs Logo

Theme Js

Let’s assume that your theme has web/js/theme.js file:

], function ($) {
    'use strict';

    $('.panel.header > .header.links').clone().appendTo('#store\\.links');

To copy the logic from this file to the breeze-powered theme you need to create Magento_Theme/layout/breeze_default.xml layout update file with following content:

<?xml version="1.0"?>
<page xmlns:xsi=""
        <referenceBlock name="breeze.js">
                <argument name="bundles" xsi:type="array">
                    <item name="default" xsi:type="array">
                        <item name="items" xsi:type="array">
                            <item name="your-theme-name-js" xsi:type="string">js/breeze/theme</item>

Read more about Breeze layout.

Then, create the js file itself web/js/breeze/theme.js and modify it to get it work without jQuery and other libraries that are not available in Breeze:

(function () {
    'use strict';

    $('.panel.header > .header.links').clone().appendTo(

Read more about Breeze js libraries.

Next up

Edit this Page