- 手动创建 Taro 4.2 + React 18 + TypeScript 项目骨架 - 配置 webpack5 编译、SCSS 样式、医疗清新主题 - 实现 API 请求层(JWT 自动注入 + token 刷新) - 实现 auth store(微信登录 + 手机号绑定 + 就诊人管理) - 实现登录页(微信一键登录 + 手机号授权绑定) - 实现首页(问候栏 + 今日健康卡片 + 快捷服务 + 即将到来) - 实现我的页面(个人信息 + 功能菜单 + 退出登录) - 健康/预约/资讯占位页 - TabBar 5 个入口:首页/健康/预约/资讯/我的
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { defineConfig } from '@tarojs/cli';
|
|
|
|
export default defineConfig(async (merge) => {
|
|
const baseConfig = {
|
|
projectName: 'hms-miniprogram',
|
|
date: '2026-4-23',
|
|
designWidth: 750,
|
|
deviceRatio: { 640: 2.34 / 2, 750: 1, 375: 2, 828: 1.81 / 2 },
|
|
sourceRoot: 'src',
|
|
outputRoot: 'dist',
|
|
plugins: [],
|
|
defineConstants: {},
|
|
copy: { patterns: [], options: {} },
|
|
framework: 'react',
|
|
compiler: 'webpack5',
|
|
sass: {
|
|
resource: ['src/styles/variables.scss'],
|
|
},
|
|
mini: {
|
|
compile: {
|
|
exclude: [],
|
|
},
|
|
postcss: {
|
|
pxtransform: { enable: true, config: {} },
|
|
cssModules: {
|
|
enable: false,
|
|
config: { namingPattern: 'module', generateScopedName: '[name]__[local]___[hash:base64:5]' },
|
|
},
|
|
},
|
|
},
|
|
h5: {
|
|
publicPath: '/',
|
|
staticDirectory: 'static',
|
|
postcss: {
|
|
autoprefixer: { enable: true, config: {} },
|
|
cssModules: {
|
|
enable: false,
|
|
config: { namingPattern: 'module', generateScopedName: '[name]__[local]___[hash:base64:5]' },
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
const devConfig = (await import('./dev')).default;
|
|
const prodConfig = (await import('./prod')).default;
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
return merge({}, baseConfig, prodConfig);
|
|
}
|
|
return merge({}, baseConfig, devConfig);
|
|
});
|