From 70ad5ddb88670f993096a6619149a45e2ae850f6 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 5 Aug 2022 18:10:08 -0400 Subject: [PATCH] Fixes certain type-only imports in webviews --- src/webviews/apps/tsconfig.json | 3 +++ src/webviews/commitDetails/protocol.ts | 3 ++- webpack.config.js | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/webviews/apps/tsconfig.json b/src/webviews/apps/tsconfig.json index 8588e19..7014f36 100644 --- a/src/webviews/apps/tsconfig.json +++ b/src/webviews/apps/tsconfig.json @@ -3,6 +3,9 @@ "compilerOptions": { "lib": ["dom", "dom.iterable", "es2020"], "outDir": "../../", + "paths": { + "@env/*": ["src/env/browser/*"] + }, "useDefineForClassFields": false }, "include": [ diff --git a/src/webviews/commitDetails/protocol.ts b/src/webviews/commitDetails/protocol.ts index 891f2cb..bd878e1 100644 --- a/src/webviews/commitDetails/protocol.ts +++ b/src/webviews/commitDetails/protocol.ts @@ -1,5 +1,6 @@ import { TextDocumentShowOptions } from 'vscode'; import type { IssueOrPullRequest } from '../../git/models/issue'; +import type { PullRequest } from '../../git/models/pullRequest'; import { IpcCommandType, IpcNotificationType } from '../protocol'; export type FileShowOptions = TextDocumentShowOptions; @@ -21,7 +22,7 @@ export type CommitDetails = { export type RichCommitDetails = { formattedMessage?: string; - pullRequest?: IssueOrPullRequest; + pullRequest?: PullRequest; issues?: IssueOrPullRequest[]; }; diff --git a/webpack.config.js b/webpack.config.js index f33d2d4..12d8fc0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -410,6 +410,9 @@ function getWebviewsConfig(mode, env) { ], }, resolve: { + alias: { + '@env': path.resolve(__dirname, 'src', 'env', 'browser'), + }, extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'], modules: [basePath, 'node_modules'], },