Files
banban/banban-mini/config/index.js

72 lines
1.5 KiB
JavaScript

const path = require('path')
const config = {
projectName: 'banban-mini',
date: '2025-3-3',
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
},
sourceRoot: 'src',
outputRoot: 'dist',
plugins: [],
defineConstants: {},
copy: {
patterns: [
{ from: 'src/assets/tab-icons', to: 'dist/assets/tab-icons' }
],
options: {}
},
framework: 'react',
mini: {
webpackChain(chain) {
chain.resolve.alias.set('@', path.resolve(__dirname, '../src'))
},
postcss: {
pxtransform: {
enable: true,
config: {}
},
url: {
enable: true,
config: { limit: 1024 }
},
cssModules: {
enable: false,
config: {
namingPattern: 'module',
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
}
},
h5: {
publicPath: '/',
staticDirectory: 'static',
webpackChain(chain) {
chain.resolve.alias.set('@', path.resolve(__dirname, '../src'))
},
postcss: {
autoprefixer: { enable: true, config: {} },
cssModules: {
enable: false,
config: {
namingPattern: 'module',
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
}
}
}
module.exports = function (merge) {
const envConfig =
process.env.NODE_ENV === 'development'
? require('./dev')
: require('./prod')
return merge({}, config, envConfig)
}