From f1635cde13e7819bc449ab08830acb90eaa79ef1 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Thu, 27 May 2021 22:37:32 +0100 Subject: [PATCH] Add support for Flarum typings in tsconfig --- js-packages/tsconfig/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js-packages/tsconfig/README.md b/js-packages/tsconfig/README.md index 7283ff3a7..4d34ffabd 100644 --- a/js-packages/tsconfig/README.md +++ b/js-packages/tsconfig/README.md @@ -23,7 +23,12 @@ A baseline `tsconfig.json` is provided below that you can modify as needed. This "include": ["src/**/*"], "compilerOptions": { // This will output typings to `dist-typings` - "declarationDir": "./dist-typings" + "declarationDir": "./dist-typings", + "paths": { + "flarum/*": ["../vendor/flarum/core/js/dist-typings/*"] + } } } ``` + +You'll also need to ensure that you run `composer update` in your extension's root directory to ensure that a copy of core is downloaded to your `vendor` folder. Remember that `vendor` should **not** be committed to git repositories.