- 小程序页面迁移到 pkg-health/pkg-mall/pkg-profile 分包目录 - 删除旧 pages/health/input、pages/mall/detail 等旧路径 - 导航路径更新为分包路径(/pages/pkg-mall/exchange/index 等) - TrendChart 组件优化 - 后台添加 admin_list_products API(支持查看已下架商品) - config/index.ts 添加 defineConstants 环境变量 - mp e2e check-readiness 路径修正
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import { defineConfig } from '@tarojs/cli';
|
|
import path from 'path';
|
|
|
|
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: {
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
|
|
'process.env.TARO_APP_API_URL': JSON.stringify(process.env.TARO_APP_API_URL || 'http://localhost:3000/api/v1'),
|
|
'process.env.TARO_APP_ENCRYPTION_KEY': JSON.stringify(process.env.TARO_APP_ENCRYPTION_KEY || ''),
|
|
},
|
|
copy: { patterns: [], options: {} },
|
|
framework: 'react',
|
|
compiler: 'webpack5',
|
|
alias: {
|
|
'@': path.resolve(__dirname, '..', 'src'),
|
|
},
|
|
sass: {
|
|
resource: ['src/styles/variables.scss'],
|
|
},
|
|
mini: {
|
|
compile: {
|
|
exclude: [],
|
|
include: [
|
|
require.resolve('zod').replace(/[\\/]index\.cjs$/, ''),
|
|
],
|
|
},
|
|
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);
|
|
});
|