nutui
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'
|
||||
import {UnifiedWebpackPluginV5} from 'weapp-tailwindcss/webpack'
|
||||
import {defineConfig} from '@tarojs/cli'
|
||||
|
||||
import devConfig from './dev'
|
||||
@@ -9,25 +9,37 @@ export default defineConfig(async (merge, {command, mode}) => {
|
||||
const baseConfig = {
|
||||
projectName: 'taro-template',
|
||||
date: '2024-12-18',
|
||||
designWidth: 750,
|
||||
designWidth(input) {
|
||||
// 配置 NutUI 375 尺寸
|
||||
if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) {
|
||||
return 375
|
||||
}
|
||||
// 全局使用 Taro 默认的 750 尺寸
|
||||
return 750
|
||||
},
|
||||
deviceRatio: {
|
||||
640: 2.34 / 2,
|
||||
750: 1,
|
||||
375: 2,
|
||||
828: 1.81 / 2
|
||||
828: 1.81 / 2,
|
||||
375: 2 / 1
|
||||
},
|
||||
sourceRoot: 'src',
|
||||
outputRoot: 'dist',
|
||||
plugins: [],
|
||||
plugins: ['@tarojs/plugin-html'],
|
||||
defineConstants: {},
|
||||
copy: {
|
||||
patterns: [],
|
||||
options: {}
|
||||
},
|
||||
framework: 'react',
|
||||
compiler: 'webpack5',
|
||||
compiler: {
|
||||
type: 'webpack5',
|
||||
prebundle: {
|
||||
exclude: ['@nutui/nutui-react-taro', '@nutui/icons-react-taro']
|
||||
}
|
||||
},
|
||||
cache: {
|
||||
enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
||||
enable: true // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
||||
},
|
||||
mini: {
|
||||
postcss: {
|
||||
|
||||
Reference in New Issue
Block a user