This commit is contained in:
2026-06-18 14:33:50 +08:00
commit 0e43ccec72
248 changed files with 30329 additions and 0 deletions

7
config/dev.ts Normal file
View File

@@ -0,0 +1,7 @@
export default {
env: {
TARO_APP_CLOUD_ENV: JSON.stringify(process.env.TARO_APP_CLOUD_ENV || 'cloud1-d4g697lte499543d8')
},
defineConstants: {}
}

57
config/index.ts Normal file
View File

@@ -0,0 +1,57 @@
import path from 'path'
import { defineConfig, type UserConfigExport } from '@tarojs/cli'
export default defineConfig<'webpack5'>(async (merge, { command }) => {
const baseConfig: UserConfigExport<'webpack5'> = {
projectName: 'wangquan-miniapp',
date: '2026-06-16',
designWidth: 390,
deviceRatio: {
390: 2,
640: 2.34,
750: 1,
828: 1.81
},
sourceRoot: 'src',
outputRoot: 'dist',
plugins: ['@tarojs/plugin-framework-react'],
defineConstants: {},
copy: {
patterns: [{ from: 'src/custom-tab-bar', to: 'dist/custom-tab-bar' }],
options: {}
},
framework: 'react',
compiler: 'webpack5',
cache: {
enable: false
},
alias: {
'@': path.resolve(__dirname, '..', 'src')
},
sass: {
data: '@use "@/styles/tokens.scss" as *;'
},
mini: {
postcss: {
pxtransform: {
enable: true,
config: {}
},
cssModules: {
enable: false,
config: {
namingPattern: 'module',
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
}
},
h5: {}
}
if (command === 'build') {
return merge({}, baseConfig, (await import('./prod')).default)
}
return merge({}, baseConfig, (await import('./dev')).default)
})

7
config/prod.ts Normal file
View File

@@ -0,0 +1,7 @@
export default {
env: {
TARO_APP_CLOUD_ENV: JSON.stringify(process.env.TARO_APP_CLOUD_ENV || 'cloud1-d4g697lte499543d8')
},
defineConstants: {}
}