鍍金池/ 問答/HTML/ vue-cli 構(gòu)建的項(xiàng)目如何拆分vendor chunk

vue-cli 構(gòu)建的項(xiàng)目如何拆分vendor chunk

使用vue-cli構(gòu)建了一個(gè)demo。有兩個(gè)entry app 和 index。 我想把index作為首頁,單獨(dú)處理。所以不想把vendor這個(gè)chunk整個(gè)加載到index頁面。應(yīng)該如何配置chunk這個(gè)部分,把vendor 拆分成 index_vendor,app_vendor,common_vendor 呢?

app頁面加載 common_vendor,app_vendor,app.js
index頁面加載 common_vendor,index_vendor,index.js

回答
編輯回答
離魂曲

你的路由需要配置,異步加載

2017年3月15日 00:06