Files
Pine c6def26b52 feat(miniprogram): OSS直链上传+资讯互动+详情页重设计
- API 基址支持 TARO_APP_API_BASE 覆盖;头像/入驻资料上传带 dir 业务目录(OSS 路径规范)
- 资讯详情:真实点赞(计数)/微信分享(openType=share+useShareAppMessage)/留言;封面 3.35:1 裁切;顶部色条修复
- 发布者徽章(官方/园区/OPC 三款渐变胶囊);头像有则显示无则不留位
- 动作按钮纯图标化并入留言标题行;留言区胶囊输入+渐变发送键
2026-08-28 17:20:10 +08:00

46 lines
1.3 KiB
JavaScript

const path = require('path');
const config = {
projectName: 'miniprogram',
date: '2026-8-20',
designWidth: 750,
deviceRatio: { 640: 2.34 / 2, 750: 1, 375: 2, 828: 1.81 },
sourceRoot: 'src',
outputRoot: 'dist',
plugins: [],
alias: {
'@': path.resolve(__dirname, '..', 'src')
},
defineConstants: {
// 构建时可覆盖 API 基址:TARO_APP_API_BASE=http://192.168.1.3:8090 yarn dev:weapp
'process.env.TARO_APP_API_BASE': JSON.stringify(process.env.TARO_APP_API_BASE || ''),
},
copy: { patterns: [], options: {} },
framework: 'react',
compiler: { type: 'webpack5', prebundle: { enable: false } },
cache: { enable: false },
mini: {
postcss: {
pxtransform: { enable: true, config: {} },
// limit 调高:内嵌像素字体等小体积资源为 base64,避免运行时路径解析问题
url: { enable: true, config: { limit: 300000 } },
cssModules: { enable: false }
}
},
h5: {
publicPath: '/',
staticDirectory: 'static',
postcss: {
autoprefixer: { enable: true, config: {} },
cssModules: { enable: false }
}
}
};
module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'));
}
return merge({}, config, require('./prod'));
};