fix(build): add chunk for linked modules to fix cyclical imports, sort test modules into test chunk
This commit is contained in:
parent
3361099729
commit
bc06121a18
|
@ -2,6 +2,7 @@
|
||||||
"names": [
|
"names": [
|
||||||
"async_hooks",
|
"async_hooks",
|
||||||
"chai",
|
"chai",
|
||||||
|
"fs",
|
||||||
"js-yaml",
|
"js-yaml",
|
||||||
"sinon"
|
"sinon"
|
||||||
]
|
]
|
||||||
|
|
|
@ -42,13 +42,9 @@ const bundle = {
|
||||||
return 'vendor';
|
return 'vendor';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id.includes(process.env['HOME'])) {
|
if (id.includes(`chai`) || id.includes(`sinon`) || id.includes('source-map')) {
|
||||||
return 'linked';
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if (id.includes(`chai`) || id.includes(`sinon`)) {
|
|
||||||
return 'test';
|
return 'test';
|
||||||
} */
|
}
|
||||||
|
|
||||||
if (id.includes(`${sep}node_modules${sep}`)) {
|
if (id.includes(`${sep}node_modules${sep}`)) {
|
||||||
return 'vendor';
|
return 'vendor';
|
||||||
|
@ -62,14 +58,18 @@ const bundle = {
|
||||||
return 'main';
|
return 'main';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag_debug) {
|
if (id.includes(process.env['HOME'])) {
|
||||||
console.log('file does not belong to any chunk:', id);
|
return 'linked';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id.length === 30 && id.match(/^[a-f0-9]+$/)) {
|
if (id.length === 30 && id.match(/^[a-f0-9]+$/)) {
|
||||||
return 'vendor';
|
return 'vendor';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag_debug) {
|
||||||
|
console.log('file does not belong to any chunk:', id);
|
||||||
|
}
|
||||||
|
|
||||||
return 'nochunk';
|
return 'nochunk';
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
|
|
Loading…
Reference in New Issue