TypeScript

This guide contains how to convert your custom plugins to using TypeScript.

First, change your plugin's filetype from .js to .ts

Compiling your TypeScript written plugins

Run the command:

npm run plugins

This will compile your TypeScript plugin to plain JavaScript.

Using NPM Packages/Dependencies

As we know importing the npm dependencies will cause a type error that the module is not installed. So what you need to do is install them manually by running this command:

npm run plugins:deps -- <...packages>

where ...packages is a list of npm packages that your plugin requires to run.

NOTE This is just an alias for

npm --prefix plugins install <...deps>

Now you can compile your plugins without facing any type errors.

Plugin Configuration [TODO]

Also, see:

Last updated