I would like to challenge the template structure of Magento 2 loader which is declared in the lib/web/mage/loader.js but I can't find where this widget is calling by Magento to override the javascript ?
I mean, I'm able to extend the widget with this code :
define(['jquery','jquery/ui','mage/translate'], function ($) {
'use strict';
$.widget("custom.loader", $.mage.loader, {
options: {
icon: '',
texts: {
loaderText: $.mage.__('Please wait...'),
imgAlt: $.mage.__('Loading...')
},
template:
'<div class="loading-mask-custom" data-role="loader">' +
'<div class="loader">' +
'<img alt="<%- data.texts.imgAlt %>" src="new path">' +
'<p><%- data.texts.loaderText %></p>' +
'</div>' +
'</div>'
}
});
return $.custom.loader; });
And to call it from the Magento_Theme module in app/design but I still have the native one (loading-mask class)