import { defineConfig, type UserConfigExport } from '@tarojs/cli' import path from 'path' // https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数 export default defineConfig<'webpack5'>(async (merge, { command, mode }) => { const baseConfig: UserConfigExport<'webpack5'> = { projectName: 'billiard-app', date: '2026-1-15', designWidth: 750, deviceRatio: { 640: 2.34 / 2, 750: 1, 375: 2, 828: 1.81 / 2 }, sourceRoot: 'src', outputRoot: 'dist', plugins: [], defineConstants: { }, copy: { patterns: [ ], options: { } }, framework: 'react', compiler: 'webpack5', alias: { '@': path.resolve(__dirname, '..', 'src') }, mini: { miniCssExtractPluginOption: { ignoreOrder: true, }, postcss: { pxtransform: { enable: true, config: { } }, cssModules: { enable: false, config: { namingPattern: 'module', generateScopedName: '[name]__[local]___[hash:base64:5]' } } }, }, h5: { publicPath: '/', staticDirectory: 'static', miniCssExtractPluginOption: { ignoreOrder: true, filename: 'css/[name].[hash].css', chunkFilename: 'css/[name].[chunkhash].css' }, postcss: { autoprefixer: { enable: true, config: {} }, cssModules: { enable: false, config: { namingPattern: 'module', generateScopedName: '[name]__[local]___[hash:base64:5]' } } }, }, rn: { appName: 'billiardApp', postcss: { cssModules: { enable: false, } } } } if (process.env.NODE_ENV === 'development') { return merge({}, baseConfig) } return merge({}, baseConfig) })