feat(小程序): 修复运行时与登录链路
This commit is contained in:
@@ -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'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user