Riot TypeScript Preprocessor
This is a utility used by the Unthink Stack. It is a Riot preprocessor that
compiles TypeScript inside of the Riot components.
Installation
npm i --save-dev @epandco/riot-typescript-preprocessor
Usage
In your build script, init the preprocessor by passing in the
registerPreprocessor
function from @riotjs/compiler
:
const {registerPreprocessor} = require('@riotjs/compiler');
const { initRiotTypeScriptPreprocessor } = require('@epandco/riot-typescript-preprocessor');
initRiotTypeScriptPreprocessor(registerPreprocessor);
Options
You can provide additional options to the init function. Each is optional.
initRiotTypeScriptPreprocessor(registerPreprocessor, {
eslintConfigPath: '...',
riotTypingsPath: '...',
additionalTypings: ['...'],
sourcePath: '...',
tsconfigPath: '...',
disableCustomResolver: false,
logModuleResolution: false
});