From 4c5a85dcc0369e7a4739b4f6147802df57df059a Mon Sep 17 00:00:00 2001 From: Timur Date: Thu, 11 May 2023 20:10:16 +1000 Subject: [PATCH 1/3] [html5 setup] new chapter about including js dependencies --- _docs/advanced-setup/html5.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/_docs/advanced-setup/html5.md b/_docs/advanced-setup/html5.md index e87c8df3..73e0a707 100644 --- a/_docs/advanced-setup/html5.md +++ b/_docs/advanced-setup/html5.md @@ -34,6 +34,38 @@ 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 + +The way you add external libraries can vary. Some Haxe externs are configured to use with Lime out of the box (like [haxe-simple-peer](https://github.com/ixiagames/haxe-simple-peer)), so you just use it with ``. Other externs may require to include appropriate js dependencies by you. There are three ways for doing so: + +1. Ship the library with your project as a separate file: + + ```xml + + ``` + + `js-libs/someLibrary.js` file will be copied to `lib` directory of the compiled project. You can change the dependency export path 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 remote link to the library: + + ```xml + + ``` + + The resulted `index.html` will have an appropriate `