We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
config.optimization.splitChunks(false) 请问这行代码干什么,我以为是关闭组件拆分,可是为什么要关闭,能不能解释下
The text was updated successfully, but these errors were encountered:
@qiaokeli111
关闭 splitChunks
splitChunks
开启 splitChunks
splitChunks 会将项目中的公共依赖提取到 chunk-vendors.xxxxxxxx.js 文件中,项目运行我们需要先加载 chunk-vendors.xxxxxxxx.js,然后再加载项目的入口文件(main.js)。然而子项目中我们需要暴露出去一个独立且完整的 JS 文件,所以就关闭了 splitChunks,将 chunk-vendors.xxxxxxxx.js 的内容合并至 main.js。
chunk-vendors.xxxxxxxx.js
main.js
补充:splitChunks 介绍
Since webpack v4, the CommonsChunkPlugin was removed in favor of optimization.splitChunks.
CommonsChunkPlugin
optimization.splitChunks
Sorry, something went wrong.
No branches or pull requests
config.optimization.splitChunks(false)
请问这行代码干什么,我以为是关闭组件拆分,可是为什么要关闭,能不能解释下
The text was updated successfully, but these errors were encountered: