From f863b881a9095c9710a8d3f904603e102aaa3d41 Mon Sep 17 00:00:00 2001 From: Yi-Ya Chen Date: Fri, 14 Feb 2025 14:18:17 +0800 Subject: [PATCH] feat: fix $ctx redefine issue Signed-off-by: Yi-Ya Chen (cherry picked from commit cbe66f4660fa58dcbb8254220f507b5514fdf41d) --- package.json | 3 ++- pkg/harvester/babel.config.js | 10 +++++++++- pkg/harvester/tsconfig.json | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 96bc2fd9..01503019 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "ip": "2.0.1", "node-polyfill-webpack-plugin": "^3.0.0", "vue-draggable-next": "^2.2.1", - "yaml": "^2.5.1" + "yaml": "^2.5.1", + "@babel/plugin-transform-class-static-block": "7.26.0" }, "resolutions": { "@types/node": "~20.10.0", diff --git a/pkg/harvester/babel.config.js b/pkg/harvester/babel.config.js index fe97df73..233eb8a1 100644 --- a/pkg/harvester/babel.config.js +++ b/pkg/harvester/babel.config.js @@ -1 +1,9 @@ -module.exports = require('@rancher/shell/pkg/babel.config'); +const baseConfig = require('@rancher/shell/pkg/babel.config'); + +module.exports = { + ...baseConfig, + plugins: [ + ...(baseConfig.plugins || []), + '@babel/plugin-transform-class-static-block' + ] +}; diff --git a/pkg/harvester/tsconfig.json b/pkg/harvester/tsconfig.json index d1d68b84..cf38d753 100644 --- a/pkg/harvester/tsconfig.json +++ b/pkg/harvester/tsconfig.json @@ -8,6 +8,7 @@ "importHelpers": true, "moduleResolution": "node", "skipLibCheck": true, + "useDefineForClassFields": false, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "sourceMap": true,