Skip to content

Commit

Permalink
feat(babel.config.js): 只替换jmapp
Browse files Browse the repository at this point in the history
  • Loading branch information
jqroom committed Oct 29, 2024
1 parent 15d3cc5 commit 1a02395
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nutui-taro-demo/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
const replaceIcons = require('@nutui/replace-icons')
const projectID = process.env.VITE_APP_PROJECT_ID

module.exports = {
presets: [
Expand All @@ -14,11 +15,11 @@ module.exports = {
],
plugins: [
['@babel/plugin-transform-typescript', { allowDeclareFields: true }],
[
projectID === 'jmapp' && [
replaceIcons({
sourceLibrary: ['@nutui/icons-react-taro', '@nutui/icons-react'],
targetLibrary: '@nutui/jdesign-icons-react-taro',
}),
],
],
].filter(Boolean),
}

0 comments on commit 1a02395

Please sign in to comment.