@vue-cli4

Stories List
@lllllxt

vue2 多頁面構建後chunks無法注入script問題

概述 @vue/cli-service@4.x下,配置了多頁面,構建後因為chunks沒有注入到html中,導致訪問頁面時頁面空白 原因 自定義了splitChunks,且單個包的大小達到某些條件後,會分割為多個包,如index~123.111.js,index~123.222.js,其中index~123是 chunkName 而html-webpack-plugin@3.x中,是判斷 i

lllllxt Avatar

@lllllxt

Nickname lllllxt_in_sf

@yuhuashi_584a46acea21f

webpack優化:提高二次構建速度

痛點: 開發過程中改一行代碼卻要等webpack構建半天實在太捉急。 項目背景 我們的項目是@vue/cli4生成的,基於webpack和vue2開發,未使用ts。用到了很多jquery、lodash、echarts等第三方依賴。 參考: @vue/cli4已經默認配置過一些優化方法了,比如為babel-loader增加cache-loder。請教了deepseek和google之後,根據項目的實

yuhuashi_584a46acea21f Avatar

@yuhuashi_584a46acea21f

Nickname 雨花石