-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vendors 包超过500kb,导致开发者工具es6 =>es5失效;window桌面版小程序报错 #9573
Comments
commonChunks不是可以自己配置吗? |
目前我项目中
```javascript
cacheGroups: {
common: {
name: 'common',
minChunks: 2,
priority: 1
},
vendors2: {
name: 'vendors2',
test: /[\\/]node_modules[\\/](taro-ui|crypto-es|)[\\/]/,
priority: 20,
enforce: true,
reuseExistingChunk: true
},
vendors3: {
name: 'vendors3',
test: /[\\/]node_modules[\\/](mobx|mobx-react|mobx-react-lite|elliptic|
react-reconciler|browserify-sign|browserify-rsa|)[\\/]/,
priority: 20,
enforce: true,
reuseExistingChunk: true
},
vendors: {
name: 'vendors',
minChunks: 2,
test: module => {
return /[\\/]node_modules[\\/]/.test(module.resource);
},
// maxSize: 900000,
priority: 10
},
taro: {
name: 'taro',
test: module => {
return taroBaseReg.test(module.context);
},
priority: 100
}
}
commonChunks: commonChunks => {
console.log('commonChunks', commonChunks);
commonChunks.push('vendors2', 'vendors3');
return commonChunks;
}
这样手动去设置chunk,我希望能通过cacheGroup时能通过maxSize分包,此时commonchunks
应该是不固定的吧?请问有方案可以满足此场景吗
dengqing ***@***.***> 于2021年7月14日周三 下午8:00写道:
… commonChunks不是可以自己配置吗?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9573 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABN2XRT7CB6GTLIOX4UX243TXV37LANCNFSM47AU5JNQ>
.
|
动态的好像不行,把react、taro、mobx 主要几个大库拆出来应该不会大于500k了吧 |
对,但是需要手动拆包,没法用maxSize这样 相当于开发者要手动控制 我看taro好像在迭代这块
dengqing ***@***.***> 于2021年7月15日周四 上午9:47写道:
… 动态的好像不行,把react、taro、mobx 主要几个大库拆出来应该不会大于500k了吧
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9573 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABN2XRSNC5RV6MRPZCHGEG3TXY423ANCNFSM47AU5JNQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
微信小程序
小程序基础库: 2.17.0
使用框架: React
复现步骤
开启开发者工具的es6转es5,当vendors体积大于500kb时,window桌面版小程序报错
期望结果
可自定义commonchunks 的name,希望由splitchunks中具体的chunksName生成
实际结果
目前commonChunks Name为代码中defaultCommonChunks 静态变量而来,无法和splitchunks中Name匹配
环境信息
The text was updated successfully, but these errors were encountered: