Skip to content

Commit d33bc14

Browse files
authored
Merge pull request #7587 from grl-wang/fix-vue-js-dependency
fix(amazonq): remove the depedency of the CDN js script.
2 parents 496e076 + fa6d9c9 commit d33bc14

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/core/scripts/build/copyFiles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const tasks: CopyTask[] = [
3131
{ target: path.join('src', 'testFixtures') },
3232
{ target: 'src/auth/sso/vue' },
3333

34+
// Vue.js for webviews
35+
{
36+
target: path.join('../../node_modules', 'vue', 'dist', 'vue.global.prod.js'),
37+
destination: path.join('libs', 'vue.min.js'),
38+
},
3439
// SSM
3540
{
3641
target: path.join('../../node_modules', 'aws-ssm-document-language-service', 'dist', 'server.js'),

packages/core/src/login/webview/commonAuthViewProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export class CommonAuthViewProvider implements WebviewViewProvider {
148148
const entrypoint =
149149
serverHostname !== undefined ? Uri.parse(serverHostname).with({ path: `/${this.source}` }) : scriptUri
150150

151+
// Get Vue.js from dist/libs directory
152+
const vueUri = Uri.joinPath(assetsPath, 'dist', 'libs', 'vue.min.js')
153+
const vueScript = webview.asWebviewUri(vueUri)
154+
151155
return `
152156
<!DOCTYPE html>
153157
<html lang="en">
@@ -158,7 +162,7 @@ export class CommonAuthViewProvider implements WebviewViewProvider {
158162
<title>Base View Extension</title>
159163
</head>
160164
<body>
161-
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.4.4/vue.global.prod.min.js"></script>
165+
<script src="${vueScript.toString()}"></script>
162166
<script>
163167
const vscode = acquireVsCodeApi();
164168
</script>

0 commit comments

Comments
 (0)