Skip to content

Compiler Options

crossrailsReed edited this page Oct 16, 2016 · 10 revisions

Global options:

Option Type Description
-p, --project string Path to a xrails.json project config file (or to a directory containing one)
-l, --logLevel choices: "debug", "info", "warning", "error" Set the complier log level , defaults to "warning"
-h, --help boolean Show help
-v, --version boolean Show version number
--exclude array A list of glob file patterns matching source files to exlude from compliation , defaults to "/node_modules/","/bower_components/","/jspm_package/"
--lib array List of built-in API groups you expect your runtime support, any of dom, webworker, es5, es6 / es2015, es2015.core, es2015.collection, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.generator, es2015.symbol, es2015.symbol.wellknown,es2016, es2016.array.include, es2017, es2017.object, es2017.sharedmemory, scripthost
--charset string The character set of the input files , defaults to "utf8"
--sourceMap file.js Path to the source map of the input file, defaults to [file.js].map , defaults to string
--declarationFile file.js Path to a typescript declaration file (.d.ts), defaults to [file.js].d.ts , defaults to string
--implicitExport boolean Expose all declarations found (by default only those marked with export are exposed) , defaults to false

Swift options:

Option Type Description
--swift null Compile source to swift (enabled automatically if any swift option specified e.g. swift.emit=gen)
--swift.javascriptcore default engine Compile source to use the JavaScriptCore engine under the hood
--swift.bundleId string The id of the bundle containing the JS source file, omit to use the main bundle
--swift.omitArgumentLabels boolean Prefix all function arguments with _ , defaults to false

Java options:

Option Type Description
--java null Compile source to java (enabled automatically if any java option specified e.g. java.emit=gen)
--java.nashorn default Compile source to use the Nashorn engine under the hood, requires Java SE/EE
--java.basePackage string The base package to root the output structure in

General options:

Option Type Description
--emit boolean Emit compiled output, defaults to beside the input files, specify a path to override location, defaults to true
--emitJS boolean Copy the input JS file into the compiled output, specify a path to override default location, defaults to true
--emitWrapper boolean Copy the JS engine wrapper into the compiled output, specify a path to override default location, defaults to true
--imports array A list of package/module names to use when an exlcuded source file needs to be imported, one for each entry in the exclude list
Clone this wiki locally