fix: 修复第三方包的 chunk 被随机到组件的问题
This commit is contained in:
parent
11b8f18033
commit
09ea8472ab
@ -59,10 +59,16 @@ export default (): UserConfigExport => {
|
|||||||
globals: {
|
globals: {
|
||||||
vue: "Vue",
|
vue: "Vue",
|
||||||
},
|
},
|
||||||
manualChunks(id) {
|
manualChunks(id) {
|
||||||
|
console.log("mmmmm",id);
|
||||||
|
|
||||||
let arr = id.toString().split('/');
|
let arr = id.toString().split('/');
|
||||||
if (arr.length >= 2) {
|
if (id.includes('node_modules')) {
|
||||||
//if (arr.length >= 2 && arr[arr.length - 1].split('.')[1] != 'ts'){
|
//id => layui-vue/node_modules/.pnpm/@vue+devtools-api@6.1.4/node_modules/@vue/devtools-api/lib/esm/api/app.js
|
||||||
|
const chunksName = "_chunks/";
|
||||||
|
return chunksName + id.toString().split('node_modules/')[2].split('/')[0].toString();
|
||||||
|
} else if (arr.length >= 2){
|
||||||
|
//if (arr.length >= 2 && arr[arr.length - 1].split('.')[1] != 'ts'){
|
||||||
let entryPoint = arr[arr.length - 2].toString()
|
let entryPoint = arr[arr.length - 2].toString()
|
||||||
if (matchModule.includes(entryPoint)) {
|
if (matchModule.includes(entryPoint)) {
|
||||||
return entryPoint;
|
return entryPoint;
|
||||||
|
Loading…
Reference in New Issue
Block a user