RTB Extension
Extension to RTB API
RTB Extension is a module that can be added to RTB API. Actually it is a function returning BuildFunction.
It receives arbitrary number of arguments and returns a BuildFunction object. With this RTB instance, users can do necessary operations during the build process. Once the extension is ready, it can be registered to RTB extension set using tron.registerExtension() function.
If the Extension returns promise, then it handled according to the promise processing mechanism involving syncMode state. Otherwise, it runs asynchronously. If synchronous actions are required, you can also use rtb.promise() function instead of returning a promise.
Registering extensions
RTB extensions can be registered to RTB API using tron.registerExtension() function.
Using extensions
If the extension are in single or multiple files, it can be loaded using tron.loadExtension() function. Once loaded, it's avaiable in RTB API.
Built-in extensions
- ext-coffeeScript: CoffeeScript transpiler.
- ext-css: Stylesheet processor supporting sass/scss/less with postcss.
- ext-javascript: JavaScript process with babel support.
- ext-markdown: Markdown transpiler.
- ext-twig: Twig builder.
- ext-typescript: TypeScript transpiler.
- ext-webpack: Webpack builder.