Setting asyc or defer on script tags

async or defer can easily be added to the script tags generated in index.html, by changing the clause in index.tpl to

		each script in scripts
			if script.src
				script(src=script.src async)
				script!= script.contents
Nothing obviously breaks if I do this.

However, I'm curious why such a straightforward performance enhancement is not the default. Are there concerns other than older browsers? (My app doesn't support anything without IndexedDB.) Is there a reason to choose async instead of defer?


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!