-
Notifications
You must be signed in to change notification settings - Fork 3.6k
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
support webpack5 #3723
Comments
使用 vue-cli 创建 alpha 分支已支持,使用中发现问题请反馈。
已知问题:
|
Awesome work! 近期我将基于此进行升级工作。 btw,为什么在webpack4的模式下微信小程序模式打包基本没有cache的构建缓存,在项目体量上来之后,目前一次完整的watch mode 启动(1600多个模块),需要至少30-40s的时间。我看到了类似如下的逻辑 我是否错过了什么说明文档,是否可以配置什么去开启cache优化呢 |
部分情况下(如使用条件编译或编译到多个平台)缓存会错乱,所以禁用了 cache。另外在 webpack5 内置了 cache 功能,但是框架近期更新并未处理和验证相关逻辑,使用时需要注意一下,后续我会单独验证和处理一下这部分。 |
btw,development开启了UNI_USING_CACHE以后,再次启动编译从26s,减少到了7s,还在进一步观察是否有缓存所带来的相关问题。但它确实会提供值得一试的优化效果 |
我也认为没到能正式使用的阶段,但希望通过写进文档吸引更多的人参与测试。 |
依赖更新到 2.0.1-alpha-35420220816001
|
好的,文档将增加一行相关说明 |
大概什么时候可以正式使用? |
希望能够尽快完成支持webpack5,webpack4和新tls版本node18不兼容 |
再观察一段时间无开发者报告相关问题 |
postcss出现一些弃用警告
|
执行 |
目前已处理完已知的兼容问题 |
@zhetengbiji 还有多久可以正式使用? |
从目前的反馈看,已经可以正式使用,将会随着下个正式版的发布调整相关文档。 |
大概几号可以正式使用。 |
从目前的反馈看,上个月已经可以正式使用。但下个正式版的发布才会调整相关文档。 |
当使用 Webpack5 时,如果在 // src/manifest.json
{
"mp-weixin": {
"optimization": {
// 开启分包优化
"subPackages": true
}
}
} 经过调试发现 uni-app/packages/vue-cli-plugin-uni/lib/split-chunks.js Lines 125 to 157 in fbc8c10
而
Webpack5 的文档在这里:https://webpack.docschina.org/plugins/split-chunks-plugin/#splitchunkscachegroupstest 目前我的处理方案是这样的,通过拦截 // vue.config.js
const { defineConfig } = require('@vue/cli-service');
module.exports = defineConfig({
configureWebpack: config => {
const { cacheGroups } = config.optimization.splitChunks;
if (cacheGroups) {
Object.keys(cacheGroups).forEach(chunkName => {
const { test } = cacheGroups[chunkName];
if (typeof test === 'function') {
cacheGroups[chunkName].test = (module, { chunkGraph }) => {
return test(module, chunkGraph.getModuleChunks(module));
};
}
});
}
},
}); 如果有空的话,还是希望官方能处理下这个问题,我看到在社区也有类似的文章,答案都是关闭 |
哥 我这个都把vue/cli 降到 4.5.15了 他还是不行 |
已经更新到正式版了,直接用cli5就行 |
webpack5的支持已经更新到正式版本了吗?我看官网上还没更新文档,求问 |
Are there any plans to support webpack5?
it seems uni is compiled via @vue/services which the new version already supports webpack 5.but simply updating the @vue/services version doesn't seem to work as there are still some uni custom plugins, is there any other way ?
The text was updated successfully, but these errors were encountered: