@develephant/corona-html5-builder
v0.3.2
Published
A CLI tool to easily build, watch, and debug your Corona HTML5 projects.
Downloads
11
Maintainers
Readme
Corona HTML5 Builder
A CLI tool to easily build, watch, and debug your Corona HTML5 projects.
Requirements
You will need NodeJS installed for macOS or Windows.
Installation
npm install -g @develephant/corona-html5-builder
The CLI will available globally via command line as coronahtml5
.
Usage
Setup
- Create a new base directory for your Corona project and HTML5 output.
- Using Corona, create a new project and select the base directory as the destination.
- Create a directory called html5_output (or whatever) in the base directory as well.
The directory tree should end up looking something like:
<base_directory>/
<corona_project>/
main.lua
...
html5_output/
Do not create the html5_output directory in the <corona_project> directory.
Initialize
Using a command line tool, navigate to the <base_directory>/<corona_project> directory and run:
coronahtml5 init --app <corona_app_name> --html full/path/to/<base_directory>/html5_output
This will create a package.lua file in your <corona_project> directory. Do not edit this file.
It's a good idea to add this file to the excludeFiles section, under the all
key in your build.settings file:
...
excludeFiles =
{
-- Exclude unnecessary files for each platform
all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", "package.lua" },
...
},
Development
See the command line options below to start working with your project.
CLI
All commands need to be run using a command line tool pointed at the <base_directory>/<corona_project> directory.
Commands
To get more details on each commands arguments, run coronahtml5 <command> -h
.
init
Initialize the package.lua
configuration file. See Initialize above.
coronahtml5 init --app <corona_app_name> --html </dest/to/html5/output_dir>
Note: All arguments are required.
build
Generate an HTML5 build of your project. The HTML5 files will be output to the html5_output directory. See Setup above.
coronahtml5 build [--clean]
Note for macOS users: To use the build
command you must run the "Setup Corona Native.app" found in the /Applications/Corona-<build>/Native/
directory. You will need to do this for each new Corona build you install (if using dailies).
watch
Start a live browser session of your HTML5 build. Add the -d
flag to open a debug session.
coronahtml5 watch [-d] [--proxy <proxy-address>]
Note: The watch process runs in its own shell session.
©2018 C. Byerley (develephant)