Skip to content

Commit 053d1f9

Browse files
author
xuying.xu
committed
fix: 修改注入版本插件
1 parent 787abb2 commit 053d1f9

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node_version: ['16', '18']
18+
node_version: ['18']
1919

2020
# Steps represent a sequence of tasks that will be executed as part of the job
2121
steps:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@
6464
"signal-exit": "3.0.3"
6565
},
6666
"devDependencies": {
67+
"babel-plugin-search-and-replace": "^1.1.1",
6768
"@octokit/core": "^4.2.0",
6869
"@types/jest": "^26.0.20",
6970
"@types/jest-image-snapshot": "^6.1.0",
7071
"@typescript-eslint/eslint-plugin": "^5.10.0",
7172
"@typescript-eslint/parser": "^5.10.0",
7273
"adm-zip": "^0.5.10",
73-
"babel-plugin-minify-replace": "^0.5.0",
7474
"canvas-to-buffer": "^1.1.1",
7575
"cross-env": "^6.0.3",
7676
"danger": "^11.2.3",

packages/f2/.fatherrc.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ export default process.env.CI && process.env.CI === 'true'
2828
},
2929
},
3030
},
31-
extraBabelPlugins: [['babel-plugin-minify-replace', {
32-
"replacements": [{
33-
"identifierName": "VERSION",
34-
"replacement": {
35-
"type": "identifier",
36-
"value": JSON.stringify(require('./package').version),
37-
}
38-
}]
39-
}]],
31+
extraBabelPlugins: [[
32+
"search-and-replace",
33+
{
34+
"rules": [
35+
{
36+
"search": "VERSION",
37+
"searchTemplateStrings": true,
38+
"replace": JSON.stringify(require('./package').version)
39+
}
40+
]
41+
}
42+
]],
4043
extraRollupPlugins: [...(isBundleVis ? [visualizer()] : [])],
4144
};

packages/f2/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export { Scale, ScaleConfig } from './deps/f2-scale/src';
66
export * from './components';
77

88
//@ts-ignore
9-
export default { version: VERSION };
9+
export default { version: 'VERSION' };

0 commit comments

Comments
 (0)