Files
hera-web/config/index.ts
T

44 lines
915 B
TypeScript

import { defineConfig } from '@tarojs/cli'
export default defineConfig(async () => ({
projectName: 'hera-web',
date: '2026-08-12',
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
},
sourceRoot: 'src',
outputRoot: process.env.TARO_ENV === 'h5' ? 'dist-h5' : 'dist',
plugins: ['@tarojs/plugin-framework-react'],
defineConstants: {
API_BASE_URL: JSON.stringify((process.env.HERA_API_BASE_URL || 'http://101.43.139.56/hera').replace(/\/+$/, ''))
},
copy: {
patterns: [],
options: {}
},
framework: 'react',
compiler: 'webpack5',
h5: {
postcss: {
pxtransform: {
enable: true,
config: { baseFontSize: 20, minRootSize: 16, maxRootSize: 40 }
}
}
},
mini: {
postcss: {
pxtransform: {
enable: true,
config: {}
},
cssModules: {
enable: false
}
}
}
}))