Skip to content
Ziemniakoss edited this page Jul 31, 2022 · 9 revisions

Welcome to the lwc-typings-generator wiki!

Instalation

To install as sfdx plugin (recommend way), execute command

sfdx plugins:install lwc-typings-generator

Basic use

To generate typings for standard library, labels and apex classes, use

sfdx typings:lwc

Run this command every time you add apex class, lightning component or custom label.

Then, for every SObject that you intend to use on frontend, use

sfdx typings:lwc:sobject -s Account,YourSobject,RemeberToSeparateThemWithComa

Done!

Advanced

Specify typings folder

Since version 2.12.0, you can specify in which folder typings should be generated. To do so, create file

.config/lwc-typings-generation-config.json

in root project directory. In this file, create JSON with field typingsPath, like this:

{
    "typingsPath": [
        "my", 
        "typings", 
        "dir"
    ]
}

From now on, typings will be generated in folder

my/typings/dir

This can be useful if you want to setup Type Script to check LWC code.

Clone this wiki locally