I would like to add my own JS to this file to add a little customization to the checkout in Magento 2.
app/code/Magento/Checkout/view/frontend/web/js/view/shipping-address/list.js
I tried copying it to my theme folder but it Magento doesn't pick it up, it still uses the file above.
app/design/frontend/Holy/mytheme/Magento_Checkout/web/js/shipping-address/list.js
How can I override this file? I thought I could have easily overriden this in my theme?
Do I need to create a module for it? And in it's /frontend/layout/checkout_index_index.xml
file add something like:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shippingAddress" xsi:type="array">
<item name="children" xsi:type="array">
<item name="address-list" xsi:type="array">
<item name="component" xsi:type="string">Holy_MyModule/js/view/shipping-address/list</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
Then I guess I can create my JS file in
app/code/Holy/MyModule/view/frontend/web/js/view/shipping-address/list.js
But how can I make sure it picks up everything from Magento_Checkout? Is there something I need to add at the beginning of the file, in define
block, Component.extend
function, or the child functions like initChildren