feat: 配置 TailwindCSS 并迁移到 Redux
- 配置 TailwindCSS 支持小程序开发
- 安装 tailwindcss, postcss, autoprefixer
- 安装 weapp-tailwindcss 插件支持小程序
- 配置 tailwind.config.js 和 postcss.config.js
- 更新 Taro 配置支持 TailwindCSS
- 从 Zustand 迁移到 Redux Toolkit
- 移除 zustand 依赖
- 安装 redux, react-redux, redux-thunk, @reduxjs/toolkit
- 重构状态管理架构:
- src/constants/ - Action 类型常量
- src/actions/ - Action creators 和异步 actions
- src/reducers/ - Reducers
- src/selectors/ - 状态选择器
- src/hooks/redux.ts - 类型化 hooks
- 更新组件使用新的 Redux API
- 保持数据持久化功能
- 更新应用配置
- 将 app.ts 重命名为 app.tsx 支持 JSX
- 添加 Redux Provider 到应用根组件
- 更新 TODO.md 标记完成状态
- 构建验证通过,所有功能正常
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { defineConfig, type UserConfigExport } from '@tarojs/cli'
|
||||
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'
|
||||
|
||||
import devConfig from './dev'
|
||||
import prodConfig from './prod'
|
||||
@@ -56,6 +57,20 @@ export default defineConfig<'vite'>(async (merge) => {
|
||||
}
|
||||
}
|
||||
},
|
||||
webpackChain(chain) {
|
||||
chain.merge({
|
||||
plugin: {
|
||||
install: {
|
||||
plugin: UnifiedWebpackPluginV5,
|
||||
args: [{
|
||||
appType: 'taro',
|
||||
// 下面个配置,会开启 rem -> rpx 的转化
|
||||
rem2rpx: true
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 小程序平台特定配置
|
||||
weapp: {
|
||||
|
||||
Reference in New Issue
Block a user