From 17f182dbcd517fe9387db225bd0986b8718fd160 Mon Sep 17 00:00:00 2001 From: "xuying.xu" Date: Wed, 18 Sep 2024 13:34:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- .github/workflows/danger-js.yml | 2 +- package.json | 2 +- packages/f2/.fatherrc.js | 21 ++++++++++++--------- packages/f2/src/index.ts | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 810146281..6802f0713 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node_version: ['16', '18'] + node_version: ['18'] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/danger-js.yml b/.github/workflows/danger-js.yml index e88cfe348..fdae4ac57 100644 --- a/.github/workflows/danger-js.yml +++ b/.github/workflows/danger-js.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node_version: ['16'] + node_version: ['18'] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/package.json b/package.json index cdf621ae8..ecdcaa1a2 100644 --- a/package.json +++ b/package.json @@ -64,13 +64,13 @@ "signal-exit": "3.0.3" }, "devDependencies": { + "babel-plugin-search-and-replace": "^1.1.1", "@octokit/core": "^4.2.0", "@types/jest": "^26.0.20", "@types/jest-image-snapshot": "^6.1.0", "@typescript-eslint/eslint-plugin": "^5.10.0", "@typescript-eslint/parser": "^5.10.0", "adm-zip": "^0.5.10", - "babel-plugin-minify-replace": "^0.5.0", "canvas-to-buffer": "^1.1.1", "cross-env": "^6.0.3", "danger": "^11.2.3", diff --git a/packages/f2/.fatherrc.js b/packages/f2/.fatherrc.js index 4aad8e2e0..8af2fbca5 100644 --- a/packages/f2/.fatherrc.js +++ b/packages/f2/.fatherrc.js @@ -28,14 +28,17 @@ export default process.env.CI && process.env.CI === 'true' }, }, }, - extraBabelPlugins: [['babel-plugin-minify-replace', { - "replacements": [{ - "identifierName": "VERSION", - "replacement": { - "type": "identifier", - "value": JSON.stringify(require('./package').version), - } - }] - }]], + extraBabelPlugins: [[ + "search-and-replace", + { + "rules": [ + { + "search": "VERSION", + "searchTemplateStrings": true, + "replace": JSON.stringify(require('./package').version) + } + ] + } + ]], extraRollupPlugins: [...(isBundleVis ? [visualizer()] : [])], }; diff --git a/packages/f2/src/index.ts b/packages/f2/src/index.ts index 2b7897bf7..0ff719105 100644 --- a/packages/f2/src/index.ts +++ b/packages/f2/src/index.ts @@ -6,4 +6,4 @@ export { Scale, ScaleConfig } from './deps/f2-scale/src'; export * from './components'; //@ts-ignore -export default { version: VERSION }; +export default { version: 'VERSION' };