From c4f078d1b6be5488e0adf9d1917563e408c109a1 Mon Sep 17 00:00:00 2001
From: Eric Amodio <eamodio@gmail.com>
Date: Tue, 28 Dec 2021 01:40:29 -0500
Subject: [PATCH] Fixes github code splitting

---
 src/git/remotes/github.ts |  2 +-
 src/github/github.ts      | 10 +++++-----
 webpack.config.js         |  8 ++++++++
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/git/remotes/github.ts b/src/git/remotes/github.ts
index f032923..a2e0d61 100644
--- a/src/git/remotes/github.ts
+++ b/src/git/remotes/github.ts
@@ -3,7 +3,6 @@ import { AuthenticationSession, Range, Uri } from 'vscode';
 import { DynamicAutolinkReference } from '../../annotations/autolinks';
 import { AutolinkReference } from '../../config';
 import { Container } from '../../container';
-import { GitHubPullRequest } from '../../github/github';
 import {
 	Account,
 	DefaultBranch,
@@ -240,6 +239,7 @@ export class GitHubRemote extends RichRemoteProvider {
 		const [owner, repo] = this.splitPath();
 		const { include, ...opts } = options ?? {};
 
+		const GitHubPullRequest = (await import('../../github/github')).GitHubPullRequest;
 		return (await Container.instance.github)?.getPullRequestForBranch(this, accessToken, owner, repo, branch, {
 			...opts,
 			include: include?.map(s => GitHubPullRequest.toState(s)),
diff --git a/src/github/github.ts b/src/github/github.ts
index 485bd8b..d44e012 100644
--- a/src/github/github.ts
+++ b/src/github/github.ts
@@ -1,14 +1,14 @@
 'use strict';
 import { graphql } from '@octokit/graphql';
 import {
-	DefaultBranch,
-	IssueOrPullRequest,
-	IssueOrPullRequestType,
+	type DefaultBranch,
+	type IssueOrPullRequest,
+	type IssueOrPullRequestType,
 	PullRequest,
 	PullRequestState,
 } from '../git/models';
-import { Account } from '../git/models/author';
-import { AuthenticationError, ClientError, RichRemoteProvider } from '../git/remotes/provider';
+import type { Account } from '../git/models/author';
+import { AuthenticationError, ClientError, type RichRemoteProvider } from '../git/remotes/provider';
 import { Logger } from '../logger';
 import { debug } from '../system';
 
diff --git a/webpack.config.js b/webpack.config.js
index a646588..6d282cc 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -142,6 +142,14 @@ function getExtensionConfig(target, mode, env) {
 							},
 					  }),
 			],
+			splitChunks: {
+				// Disable all non-async code splitting
+				chunks: () => false,
+				cacheGroups: {
+					default: false,
+					vendors: false,
+				},
+			},
 		},
 		externals: {
 			vscode: 'commonjs vscode',