Setup HTML5

Lime and OpenFL may be used to create HTML5 applications and games for web browsers by compiling to JavaScript

Automatic Install

There is no automatic setup available for HTML5.

Manual Install

There is generally no setup required for the HTML5 target.

Build & Run

To compile an HTML5 application, run lime build html5.

To compile and launch an HTML5 application with one command, run lime test html5. This will start a local development server, and launch the page in a web browser.

Minification

Adding either the -minify option or the -final option to your build command will apply more advanced minification to the generated JavaScript. By default, Closure Compiler will be used to minify, but you can specify -yui to use YUI Compressor instead. Both minification tools require Java to be installed.

Launch Options

The default port used by the local development server is port 3000. To customize this port, specify the --port option with a value such as --port=8080.

To compile and start the local development server, but skip launching in a web browser, add the -nolaunch option.

Using JavaScript libraries

To use an external JavaScript library with Lime, you need Haxe externs. See also Haxe: Using external JavaScript libraries.

Members of the Haxe community have already created open source externs for a number of popular JavaScript libraries, so be sure to search Haxelib or Github to see if JS externs exist for your library before you try to create your own.

Forums

If you encounter any problems when setting up Lime for HTML5, please visit the forums.


Improve this page