Last active
January 27, 2016 01:55
-
-
Save andrewhowdencom/94b72aa4ff84562adbcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- SUPER HACKY FAST WRITEUP --> | |
<!-- This does nothing --> | |
<script data-main="path/main.js" /> | |
<!-- Not so good, as it blocks DOM --> | |
<script type="text/javascript" src="require.js" /> | |
<script type="text/javascript" src="path/main.js" /> | |
<!-- Not so good, as main.js may include require(['foo', 'bar'], function(f, b) {}); which has no meaning outside require.js --> | |
<!-- (And you can't guarantee main.js won't be executed before require.js) --> | |
<script type="text/javascript" src="require.js" async defer /> | |
<script type="text/javascript" src="path/main.js" async defer /> | |
<!-- Pretty good, as we can now load javascript with dependencies asynchronously --> | |
<script type="text/javascript" src="require.js" data-main="path/main" async defer /> | |
<!-- Awesome; Javascript without dependencies. Who cares when it runs --> | |
<script type="text/javascript" src="module.js" async defer/> | |
<script type="text/javascript" src="module2.js" async defer /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment