import path from 'path' import { defineConfig, type UserConfigExport } from '@tarojs/cli' export default defineConfig(async (merge) => { const baseConfig: UserConfigExport = { projectName: 'nomadmini', date: '2026-3-23', designWidth: 750, deviceRatio: { 640: 2.34 / 2, 750: 1, 375: 2, 828: 1.81 / 2, }, sourceRoot: 'src', outputRoot: 'dist', plugins: ['@tarojs/plugin-framework-react'], defineConstants: { TARO_APP_API: JSON.stringify(process.env.TARO_APP_API || 'https://api.nomadro.cn'), }, copy: { patterns: [], options: {}, }, framework: 'react', compiler: { type: 'webpack5', prebundle: { enable: false, }, }, cache: { enable: false, }, alias: { '@': path.resolve(__dirname, '..', 'src'), }, mini: { postcss: { pxtransform: { enable: true, config: {}, }, cssModules: { enable: false, }, }, }, h5: { publicPath: '/', staticDirectory: 'static', postcss: { autoprefixer: { enable: true }, cssModules: { enable: false }, }, }, } if (process.env.NODE_ENV === 'development') { return merge({}, baseConfig, { logger: { quiet: false, stats: true }, }) } return merge({}, baseConfig) })