60 lines
1.2 KiB
TypeScript
60 lines
1.2 KiB
TypeScript
import { defineConfig, type UserConfigExport } from '@tarojs/cli'
|
|
import path from 'node:path'
|
|
|
|
const outputRoot = `dist/${process.env.TARO_ENV ?? 'weapp'}`
|
|
|
|
const config: UserConfigExport<'webpack5'> = {
|
|
projectName: 'batiao-pay',
|
|
date: '2026-07-14',
|
|
designWidth: 750,
|
|
deviceRatio: {
|
|
640: 2.34 / 2,
|
|
750: 1,
|
|
828: 1.81 / 2,
|
|
},
|
|
sourceRoot: 'src',
|
|
outputRoot,
|
|
framework: 'react',
|
|
compiler: 'webpack5',
|
|
plugins: ['@tarojs/plugin-framework-react'],
|
|
alias: {
|
|
'@': path.resolve(__dirname, '..', 'src'),
|
|
},
|
|
defineConstants: {},
|
|
copy: {
|
|
patterns: [
|
|
{
|
|
from: 'static/image',
|
|
to: `${outputRoot}/static/image`,
|
|
},
|
|
],
|
|
options: {},
|
|
},
|
|
cache: {
|
|
enable: false,
|
|
},
|
|
mini: {
|
|
postcss: {
|
|
pxtransform: {
|
|
enable: true,
|
|
config: {},
|
|
},
|
|
url: {
|
|
enable: true,
|
|
config: {
|
|
limit: 1024,
|
|
},
|
|
},
|
|
cssModules: {
|
|
enable: false,
|
|
config: {
|
|
namingPattern: 'module',
|
|
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
export default defineConfig<'webpack5'>(() => config)
|