@epandco/riot-typescript-preprocessor
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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, {

// Path to the eslint config file.
// Default is the process root.
eslintConfigPath: '...',

// Path to the typings for Riot files.
// Default is sourcePath + /client/typings.d.ts
riotTypingsPath: '...',

// Paths to additional typings (.d.ts) files
additionalTypings: ['...'],

// Root path for the source files.
// Defaults to './src'.
sourcePath: '...',

// Path to the tsconfig file to use with the TypeScript compiler.
// Defaults to the clientRootPath + 'tsconfig.json'.
tsconfigPath: '...',

// Set to true to disable the custom module resolver function.
// Defaults to false.
disableCustomResolver: false,

// Set to true to enable debug logging of module resolution.
// Defaults to false
logModuleResolution: false

});

Package Sidebar

Install

npm i @epandco/riot-typescript-preprocessor

Weekly Downloads

4

Version

1.2.1

License

MIT

Unpacked Size

21.2 kB

Total Files

10

Last publish

Collaborators

  • ever.orellana
  • katklauber
  • danhuri
  • trevorjpuckett
  • logan.jenkins
  • jmiewalker
  • darius.walker
  • epco-ctlabs
  • tphilyaw
  • christopherducharme
  • emswann