Skip to content

Commit 61f6431

Browse files
authored
feat(replace icon): 替换jmapp icon (#2672)
* Update infiniteloading.taro.tsx * Update infiniteloading.tsx * fix(tabs.taro.tsx): 解决在不需要滚动的时候,切换tab产生tab位置错乱的问题 滚动不可为负值,负值会导致在不需要滚动的时候,tab位置发生不可预知的顺序变化。 * fix(tabs.taro.tsx): 解决页面元素不需要滚动时,切换tab,tab顺序发生不可预知的变化的问题 * Update tabs.taro.tsx 修复格式问题 * Update tabs.taro.tsx 修改格式问题 * feat: 增加 demo 场景 * feat: 增加icon替换插件 * feat: 增加sourceLibrary参数配置 * feat: 增加lock file * feat: 修改包路径 * Revert "feat: 增加 demo 场景" This reverts commit 9ce77c4. * feat(babel.config.js): 只替换jmapp * feat(npmrc): 修改npm源 * feat: 同步pnpm lock * feat: 调整版本号@nutui/replace-icons * feat: 移除子目录的npmrc
1 parent c0b757c commit 61f6431

File tree

5 files changed

+5191
-3127
lines changed

5 files changed

+5191
-3127
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
registry=https://registry.npmjs.org/
22
engine-strict=true
33
strict-peer-dependencies=false
4+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"@babel/runtime": "^7.23.9",
9898
"@nutui/icons-react": "^1.0.5",
9999
"@nutui/icons-react-taro": "^1.0.5",
100+
"@nutui/jdesign-icons-react-taro": "1.0.6-beta.2",
100101
"@nutui/touch-emulator": "^1.0.0",
101102
"@react-spring/web": "~9.6.1",
102103
"@use-gesture/react": "10.2.20",
@@ -118,7 +119,6 @@
118119
"@commitlint/cli": "^19.0.3",
119120
"@commitlint/config-conventional": "^19.0.3",
120121
"@loadable/component": "^5.16.3",
121-
"prettier-markdown-table": "^1.0.2",
122122
"@mdx-js/mdx": "^3.0.1",
123123
"@mdx-js/react": "^3.0.1",
124124
"@mdx-js/rollup": "^3.0.1",
@@ -184,6 +184,7 @@
184184
"postcss-rtlcss": "^5.1.0",
185185
"postcss-scss": "^4.0.9",
186186
"prettier": "^3.2.5",
187+
"prettier-markdown-table": "^1.0.2",
187188
"react": "^18.2.0",
188189
"react-color": "^2.19.3",
189190
"react-dom": "^18.2.0",

packages/nutui-taro-demo/babel.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// babel-preset-taro 更多选项和默认值:
22
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3+
const replaceIcons = require('@nutui/replace-icons')
4+
const projectID = process.env.VITE_APP_PROJECT_ID
5+
36
module.exports = {
47
presets: [
58
[
@@ -12,5 +15,11 @@ module.exports = {
1215
],
1316
plugins: [
1417
['@babel/plugin-transform-typescript', { allowDeclareFields: true }],
15-
],
18+
projectID === 'jmapp' && [
19+
replaceIcons({
20+
sourceLibrary: ['@nutui/icons-react-taro', '@nutui/icons-react'],
21+
targetLibrary: '@nutui/jdesign-icons-react-taro',
22+
}),
23+
],
24+
].filter(Boolean),
1625
}

packages/nutui-taro-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"author": "",
4646
"dependencies": {
4747
"@babel/runtime": "^7.23.9",
48+
"@nutui/replace-icons": "^1.0.0",
4849
"@nutui/touch-emulator": "^1.0.0",
4950
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
5051
"@tarojs/components": "3.6.22",
@@ -68,7 +69,6 @@
6869
"react": "^18.2.0",
6970
"react-dom": "^18.2.0",
7071
"react-refresh": "^0.14.0"
71-
7272
},
7373
"devDependencies": {
7474
"@babel/core": "^7.23.9",

0 commit comments

Comments
 (0)