Transpile
steal-tools.BuildOptions.transpile
Allows the ability to completely control the transpiling of ES2015 source down to another format for production bundling (usually to AMD).
transpile(source, compileOptions)
Parameters
-
source
{String}
The ES2015 source code to be transpiled.
-
compileOptions
{TranspileCompileOptions}
The options needed to be used to do the transpile, such as the format being transpiled to, and whether source maps are needed.
Returns
{SourceObject}
An object containing code
and (optionally) map
properties.
The transpile option gives you complete control over transpiling. After StealTools has created a graph of your project's dependencies it then goes through each and transpiles them into a common format, usually AMD for the multi-build.
If you're using a specific version of Traceur, Babel, or a different transpiler altogether, you might want to use this so that you can do your own transpiling.
Here's an example of usage: