feat(小程序): 修复运行时与登录链路

This commit is contained in:
stu2not
2026-04-22 17:25:03 +08:00
parent 24b1d1025b
commit d7df6f565c
12 changed files with 297 additions and 426 deletions

View File

@@ -12,31 +12,38 @@ const config = {
sourceRoot: 'src',
outputRoot: 'dist',
plugins: [],
defineConstants: {},
alias: {
'@': path.resolve(__dirname, '..', 'src'),
react: path.resolve(__dirname, '..', 'node_modules/react')
},
defineConstants: {
},
copy: {
patterns: [
{ from: 'src/assets/tab-icons', to: 'dist/assets/tab-icons' }
],
options: {}
options: {
}
},
framework: 'react',
mini: {
webpackChain(chain) {
chain.resolve.alias.set('@', path.resolve(__dirname, '../src'))
},
postcss: {
pxtransform: {
enable: true,
config: {}
config: {
}
},
url: {
enable: true,
config: { limit: 1024 }
config: {
limit: 1024 // 设定转换尺寸上限
}
},
cssModules: {
enable: false,
enable: false, // 默认为 false如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module',
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
@@ -45,15 +52,16 @@ const config = {
h5: {
publicPath: '/',
staticDirectory: 'static',
webpackChain(chain) {
chain.resolve.alias.set('@', path.resolve(__dirname, '../src'))
},
postcss: {
autoprefixer: { enable: true, config: {} },
cssModules: {
enable: false,
autoprefixer: {
enable: true,
config: {
namingPattern: 'module',
}
},
cssModules: {
enable: false, // 默认为 false如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
@@ -62,10 +70,8 @@ const config = {
}
module.exports = function (merge) {
const envConfig =
process.env.NODE_ENV === 'development'
? require('./dev')
: require('./prod')
return merge({}, config, envConfig)
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'))
}
return merge({}, config, require('./prod'))
}