diff --git a/_docs/advanced-setup/html5.md b/_docs/advanced-setup/html5.md index e87c8df..9a7724f 100644 --- a/_docs/advanced-setup/html5.md +++ b/_docs/advanced-setup/html5.md @@ -2,7 +2,7 @@ title: Setup HTML5 --- -Lime and OpenFL may be used to create [HTML5](https://developer.mozilla.org/en-US/docs/Glossary/HTML5) applications and games for web browsers by [compiling to JavaScript](https://haxe.org/manual/target-javascript.html) +Lime and OpenFL may be used to create [HTML5](https://developer.mozilla.org/en-US/docs/Glossary/HTML5) applications and games for web browsers by [compiling to JavaScript](https://haxe.org/manual/target-javascript.html). ## Automatic Install @@ -34,6 +34,46 @@ To use an external JavaScript library with Lime, you need [Haxe externs](https:/ Members of the Haxe community have already created open source externs for a number of popular JavaScript libraries, so be sure to search [Haxelib](https://lib.haxe.org/search) or [Github](https://github.com/search) to see if JS externs exist for your library before you try to create your own. +### Adding dependencies + +To actually use external JS libraries you must include them in _project.xml_. There are three options: + +1. Ship the library with your project as a separate file: + + ```xml + + ``` + + The _js-libs/someLibrary.js_ file will be copied into the compiled project's _lib_ directory. You can change the dependency export path (e.g. from _lib_ to _js_) with this config: + + ```xml + + ``` + +2. Embed the library: + + ```xml + + ``` + + The content of _js-libs/someLibrary.js_ will be embedded into compiled application's _.js_ file. + +3. Add a remote link to the library: + + ```xml + + ``` + + The resulting _index.html_ will have an appropriate `