openfl/lime-tools — pull request #73 by catdawg (2014-04-24 16:24:51+00:00)
Title: html5 target now supports dependencies.

Hello,

It is now possible to include a javascript files, through an haxelib.
The way to do it similar to how the dependencies work in Android and iOS. You basically specify a path to a folder which has the files of your dependency. In that folder there should also be an additional include.htm file. This include.htm file be injected into the template for html5 and should be used to load javascript files and such. All dependencies will be copied into a "deps" folder in the html5 Export.

For example:

SomeHTML5Haxelib/dependencies/JSLib/jslib.js

SomeHTML5Haxelib/dependencies/JSLib/include.htm

SomeHTML5Haxelib/include.xml

The resulting template execution on index.html will inject the contents of include.htm via the:

::if (JAVASCRIPT_LIBRARIES)::::foreach (JAVASCRIPT_LIBRARIES)::

::includeHTML::::end::::end::

So the final index.html will successfully load the javascript file and it will be available for use in Haxe code through the usual "extern" or "untyped __js__".

Its a pretty simple feature, but helps a lot with bringing even more autonomy to haxelibs.

This pull request is connected to another one in lime. https://github.com/openfl/lime/pull/146

Thanks!
Rui.