nomadweb/wemini/config/index.ts
eric 73b0513b9c Add WeChat, Douyin, and offline XHS mini-program scaffolds.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-27 12:57:18 -05:00

38 lines
1.2 KiB
TypeScript

import path from 'path'
import { defineConfig, type UserConfigExport } from '@tarojs/cli'
export default defineConfig(async (merge) => {
const baseConfig: UserConfigExport = {
projectName: 'wemini',
date: '2026-9-27',
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://nomadweb.nomadro.com/api/v1'),
},
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)
})