Timeline for How to load js file first in Magento 2
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 17, 2020 at 10:53 | comment | added | Ben Crook | Ah I see, yeah that would work but not in this use case as there is a dependency on jQuery, jQuery UI, Magento's core validation, and translations :( | |
Aug 15, 2020 at 5:15 | comment | added | Pratik Oza | Above solution will load JS file at the top where code should be written without any dependency(core JS). Using RequireJS as you've mentioned we cannot manually manage the sort order of JS because RequireJS loads its module source files asynchronously, and doesn't promise anything about the order they're loaded in. Just we can manage "load order" dependencies using RequireJS shim configuration directive. | |
Aug 14, 2020 at 9:23 | comment | added | Ben Crook |
Wouldn't this error as require is not yet defined?
|
|
Aug 14, 2020 at 9:18 | history | answered | Pratik Oza | CC BY-SA 4.0 |