Skip to content

Commit

Permalink
chore(config): 优化 taro demo 环境配置文件 (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud authored Jul 28, 2023
1 parent d7da5bc commit 2f9c681
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 33 deletions.
35 changes: 34 additions & 1 deletion src/sites/mobile-taro/config/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@ module.exports = {
NODE_ENV: '"development"',
},
defineConstants: {},
mini: {},
mini: {
webpackChain(chain, webpack) {
chain.optimization.splitChunks({
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
common: {
name: 'common',
minChunks: 2,
priority: 1,
},
vendors: {
name: 'vendors',
minChunks: 2,
test: (module) => {
return /[\\/]node_modules[\\/]/.test(module.resource)
},
priority: 10,
},
// taro: {
// name: 'taro',
// test: (module) => {
// if (/@tarojs[\\/][a-z]+/.test(module.context)) {
// console.log(module.context)
// }
// return /@tarojs[\\/][a-z]+/.test(module.context)
// },
// priority: 100,
// },
},
})
},
},
h5: {},
}
32 changes: 0 additions & 32 deletions src/sites/mobile-taro/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,6 @@ const config = {
},
framework: 'react',
mini: {
webpackChain(chain, webpack) {
chain.optimization.splitChunks({
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
common: {
name: 'common',
minChunks: 2,
priority: 1,
},
vendors: {
name: 'vendors',
minChunks: 2,
test: (module) => {
return /[\\/]node_modules[\\/]/.test(module.resource)
},
priority: 10,
},
// taro: {
// name: 'taro',
// test: (module) => {
// if (/@tarojs[\\/][a-z]+/.test(module.context)) {
// console.log(module.context)
// }
// return /@tarojs[\\/][a-z]+/.test(module.context)
// },
// priority: 100,
// },
},
})
},
postcss: {
pxtransform: {
enable: true,
Expand Down

0 comments on commit 2f9c681

Please sign in to comment.