Skip to content

Commit 1a02395

Browse files
committed
feat(babel.config.js): 只替换jmapp
1 parent 15d3cc5 commit 1a02395

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// babel-preset-taro 更多选项和默认值:
22
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
33
const replaceIcons = require('@nutui/replace-icons')
4+
const projectID = process.env.VITE_APP_PROJECT_ID
45

56
module.exports = {
67
presets: [
@@ -14,11 +15,11 @@ module.exports = {
1415
],
1516
plugins: [
1617
['@babel/plugin-transform-typescript', { allowDeclareFields: true }],
17-
[
18+
projectID === 'jmapp' && [
1819
replaceIcons({
1920
sourceLibrary: ['@nutui/icons-react-taro', '@nutui/icons-react'],
2021
targetLibrary: '@nutui/jdesign-icons-react-taro',
2122
}),
2223
],
23-
],
24+
].filter(Boolean),
2425
}

0 commit comments

Comments
 (0)