Skip to content

Commit

Permalink
remove vulnerable package and fix KXI-45460
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-Carneiro-KX committed May 14, 2024
1 parent 1901b16 commit cece39b
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 94 deletions.
48 changes: 20 additions & 28 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
const { build } = require("esbuild");
const { copy } = require("esbuild-plugin-copy");
const fs = require("fs");
const path = require("path");
const glob = require("glob");

function copyFiles(srcPattern, destDir) {
glob.sync(srcPattern).forEach((file) => {
const destFile = path.join(destDir, path.basename(file));
fs.copyFileSync(file, destFile);
});
}

const baseConfig = {
bundle: true,
Expand Down Expand Up @@ -32,33 +41,6 @@ const webviewConfig = {
entryPoints: ["./src/webview/main.ts"],
external: ["vscode"],
outfile: "./out/webview.js",
plugins: [
copy({
resolveFrom: "cwd",
assets: [
{
from: ["src/webview/styles/*.css"],
to: ["./out"],
},
{
from: ["node_modules/ag-grid-community/styles/ag-grid.min.css"],
to: ["./out"],
},
{
from: [
"node_modules/ag-grid-community/styles/ag-theme-alpine.min.css",
],
to: ["./out"],
},
{
from: [
"node_modules/ag-grid-community/dist/ag-grid-community.min.js",
],
to: ["./out"],
},
],
}),
],
};

(async () => {
Expand All @@ -68,6 +50,16 @@ const webviewConfig = {
await build(serverConfig);
console.log("server build complete");
await build(webviewConfig);
copyFiles("src/webview/styles/*.css", "./out");
copyFiles("node_modules/ag-grid-community/styles/ag-grid.min.css", "./out");
copyFiles(
"node_modules/ag-grid-community/styles/ag-theme-alpine.min.css",
"./out",
);
copyFiles(
"node_modules/ag-grid-community/dist/ag-grid-community.min.js",
"./out",
);
console.log("build complete");
} catch (err) {
process.stderr.write(err.stderr);
Expand Down
Loading

0 comments on commit cece39b

Please sign in to comment.