diff --git a/package-lock.json b/package-lock.json
index aa888275..8b940916 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -32,6 +32,7 @@
"@types/react-datepicker": "^4.8.0",
"@types/react-dom": "17.0.0",
"@types/vscode": "^1.90.0",
+ "@types/webpack-bundle-analyzer": "^4.7.0",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"@vscode/l10n": "^0.0.14",
@@ -96,13 +97,14 @@
"uniforms-bridge-json-schema": "^3.10.2",
"uniforms-unstyled": "^3.10.2",
"url-join-ts": "^1.0.5",
- "vscrui": "^0.1.0-beta.1092162",
+ "vscrui": "^0.1.0-beta.1093954",
"wc-react": "github:estruyf/wc-react",
"webpack": "^5.75.0",
- "webpack-bundle-analyzer": "^4.7.0",
+ "webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"webpack-ignore-dynamic-require": "^1.0.0",
+ "webpack-manifest-plugin": "^5.0.0",
"yaml": "^2.2.1",
"yawn-yaml": "^1.5.0"
},
@@ -2075,6 +2077,26 @@
"source-map": "^0.6.0"
}
},
+ "node_modules/@types/webpack-bundle-analyzer": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/@types/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.7.0.tgz",
+ "integrity": "sha512-c5i2ThslSNSG8W891BRvOd/RoCjI2zwph8maD22b1adtSns20j+0azDDMCK06DiVrzTgnwiDl5Ntmu1YRJw8Sg==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*",
+ "tapable": "^2.2.0",
+ "webpack": "^5"
+ }
+ },
+ "node_modules/@types/webpack-bundle-analyzer/node_modules/tapable": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
+ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/@types/webpack-sources": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-3.2.3.tgz",
@@ -11015,6 +11037,12 @@
"websocket-driver": "^0.7.4"
}
},
+ "node_modules/source-list-map": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
+ "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==",
+ "dev": true
+ },
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -12311,9 +12339,9 @@
}
},
"node_modules/vscrui": {
- "version": "0.1.0-beta.1092162",
- "resolved": "https://registry.npmjs.org/vscrui/-/vscrui-0.1.0-beta.1092162.tgz",
- "integrity": "sha512-fEMEtNbGo96kZX+0mBDMFAFh9qMpzw6yHxEKT5/ujM6GqZ4fpqlW4GWzeA4jsdNJNPpyy/eW7uwjbPaYjXeQQw==",
+ "version": "0.1.0-beta.1093954",
+ "resolved": "https://registry.npmjs.org/vscrui/-/vscrui-0.1.0-beta.1093954.tgz",
+ "integrity": "sha512-ncAOeVL7b48yckb4qqXUTeHMaGmrcZrFo1Yuyq09t1qn4QPDQsWqfYTwuWupVjoEfnCVCWohj9kaGFSHz6xJ8Q==",
"dev": true,
"funding": {
"type": "github",
@@ -12415,9 +12443,9 @@
}
},
"node_modules/webpack-bundle-analyzer": {
- "version": "4.10.1",
- "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz",
- "integrity": "sha512-s3P7pgexgT/HTUSYgxJyn28A+99mmLq4HsJepMPzu0R8ImJc52QNqaFYW1Z2z2uIb1/J3eYgaAWVpaC+v/1aAQ==",
+ "version": "4.10.2",
+ "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.2.tgz",
+ "integrity": "sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==",
"dev": true,
"dependencies": {
"@discoveryjs/json-ext": "0.5.7",
@@ -12428,7 +12456,6 @@
"escape-string-regexp": "^4.0.0",
"gzip-size": "^6.0.0",
"html-escaper": "^2.0.2",
- "is-plain-object": "^5.0.0",
"opener": "^1.5.2",
"picocolors": "^1.0.0",
"sirv": "^2.0.3",
@@ -12653,6 +12680,44 @@
"integrity": "sha512-WeGFPgwDochKPwizAu5XsHcPq3aaQLl2E+n1piD/VPGNUo5HIwrtURWNMfrPDfkHVOx+flkAihXbUiILAv5x4Q==",
"dev": true
},
+ "node_modules/webpack-manifest-plugin": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/webpack-manifest-plugin/-/webpack-manifest-plugin-5.0.0.tgz",
+ "integrity": "sha512-8RQfMAdc5Uw3QbCQ/CBV/AXqOR8mt03B6GJmRbhWopE8GzRfEpn+k0ZuWywxW+5QZsffhmFDY1J6ohqJo+eMuw==",
+ "dev": true,
+ "dependencies": {
+ "tapable": "^2.0.0",
+ "webpack-sources": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12.22.0"
+ },
+ "peerDependencies": {
+ "webpack": "^5.47.0"
+ }
+ },
+ "node_modules/webpack-manifest-plugin/node_modules/tapable": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
+ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/webpack-manifest-plugin/node_modules/webpack-sources": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.1.tgz",
+ "integrity": "sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==",
+ "dev": true,
+ "dependencies": {
+ "source-list-map": "^2.0.1",
+ "source-map": "^0.6.1"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
"node_modules/webpack-merge": {
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz",
diff --git a/package.json b/package.json
index 911984bc..bc8951ad 100644
--- a/package.json
+++ b/package.json
@@ -2853,6 +2853,7 @@
"@types/react-datepicker": "^4.8.0",
"@types/react-dom": "17.0.0",
"@types/vscode": "^1.90.0",
+ "@types/webpack-bundle-analyzer": "^4.7.0",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"@vscode/l10n": "^0.0.14",
@@ -2917,13 +2918,14 @@
"uniforms-bridge-json-schema": "^3.10.2",
"uniforms-unstyled": "^3.10.2",
"url-join-ts": "^1.0.5",
- "vscrui": "^0.1.0-beta.1092162",
+ "vscrui": "^0.1.0-beta.1093954",
"wc-react": "github:estruyf/wc-react",
"webpack": "^5.75.0",
- "webpack-bundle-analyzer": "^4.7.0",
+ "webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"webpack-ignore-dynamic-require": "^1.0.0",
+ "webpack-manifest-plugin": "^5.0.0",
"yaml": "^2.2.1",
"yawn-yaml": "^1.5.0"
},
diff --git a/src/commands/Chatbot.ts b/src/commands/Chatbot.ts
index 7210dd75..629d4fa6 100644
--- a/src/commands/Chatbot.ts
+++ b/src/commands/Chatbot.ts
@@ -6,6 +6,7 @@ import { WebviewHelper } from '@estruyf/vscode';
import { getLocalizationFile } from '../utils/getLocalizationFile';
import * as l10n from '@vscode/l10n';
import { LocalizationKey } from '../localization';
+import { getWebviewJsFiles } from '../utils';
export class Chatbot {
/**
@@ -56,7 +57,7 @@ export class Chatbot {
}
});
- const dashboardFile = 'dashboardWebView.js';
+ const webviewFile = 'dashboard.main.js';
const localPort = `9000`;
const localServerUrl = `localhost:${localPort}`;
@@ -66,7 +67,6 @@ export class Chatbot {
const isProd = ext.isProductionMode;
const version = ext.getVersion();
const isBeta = ext.isBetaVersion();
- const extensionUri = ext.extensionPath;
const csp = [
`default-src 'none';`,
@@ -82,13 +82,11 @@ export class Chatbot {
}`
];
- let scriptUri = '';
+ let scriptUris = [];
if (isProd) {
- scriptUri = webView.webview
- .asWebviewUri(Uri.joinPath(extensionUri, 'dist', dashboardFile))
- .toString();
+ scriptUris = await getWebviewJsFiles('dashboard', webView.webview);
} else {
- scriptUri = `http://${localServerUrl}/${dashboardFile}`;
+ scriptUris.push(`http://${localServerUrl}/${webviewFile}`);
}
// By default, the chatbot is seen as experimental
@@ -111,7 +109,11 @@ export class Chatbot {
experimental ? `data-experimental="${experimental}"` : ''
} style="width:100%;height:100%;margin:0;padding:0;">
-
+ ${scriptUris
+ .map((uri) => ``)
+ .join('\n')}
+
+