code-splitting:代码拆分;把一个大型 JavaScript 应用按“路由 / 功能 / 组件”等维度切成多个较小的文件(chunk),让浏览器按需加载,从而减少首屏体积、提升加载速度与性能。(在前端工程化中最常见)
/ˈkoʊd ˌsplɪtɪŋ/
We use code-splitting to make the first page load faster.
我们使用代码拆分来让首页加载更快。
By applying code-splitting with dynamic imports, the app only downloads the editor module when the user opens it.
通过结合动态导入进行代码拆分,应用只会在用户打开编辑器时才下载编辑器模块。
code-splitting 是由 code(代码)+ splitting(拆分) 构成的复合词;其中 split 源自古英语 splītan(“劈开、分裂”)。该术语在现代前端打包与模块化(如 Webpack、Rollup、React 等生态)中广泛使用,用来描述“把代码分成可按需加载的块”的优化策略。