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: {}, 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')); };