Skip to content

Commit

Permalink
chore(config): nutui 的尺寸单位特殊处理
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmin0412 committed Jul 1, 2024
1 parent 88259dc commit 9a6a01b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ const plugins = require('./plugins')
const config = {
projectName: 'taro3-react-template',
date: '2021-12-10',
designWidth: 750,
designWidth(input) {
// nutui 组件库需要特殊处理
if (input?.file.replace(/\\+/g, '/').indexOf('@nutui/nutui-react-taro') > -1) {
return 375
}
return 750
},
deviceRatio: {
375: 2 / 1,
640: 2.34 / 2,
750: 1,
828: 1.81 / 2,
Expand All @@ -28,8 +35,9 @@ const config = {
compiler: {
type: 'webpack5',
prebundle: {
// exclude 掉第三方库,规避 prebundle 模式下可能出现的报错
exclude: ['@nutui/nutui-react-taro']
}
},
},
framework: 'react',
mini: {
Expand Down

0 comments on commit 9a6a01b

Please sign in to comment.