Skip to main content

Posts

Showing posts with the label What is data-main attribute in RequireJS?

What Is data-main attribute in RequireJS?

What is data-main attribute? The data-main attribute is an attribute that RequireJS will check to start script loading. The data-main set to the base URL for all the scripts. Example - <! DOCTYPE html > < html > < head >      < script   data-main = "libs/main"   src = "libs/require.js" ></ script > </ head > < body >      < h1 >  RequireJS Sample apps </ h1 > </ body > </ html > I hope you are enjoying with this post! Please share with you friends!! Thank you!!!