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": [
|
||||
"async_hooks",
|
||||
"chai",
|
||||
"fs",
|
||||
"js-yaml",
|
||||
"sinon"
|
||||
]
|
||||
|
|
|
@ -42,13 +42,9 @@ const bundle = {
|
|||
return 'vendor';
|
||||
}
|
||||
|
||||
if (id.includes(process.env['HOME'])) {
|
||||
return 'linked';
|
||||
}
|
||||
|
||||
/* if (id.includes(`chai`) || id.includes(`sinon`)) {
|
||||
if (id.includes(`chai`) || id.includes(`sinon`) || id.includes('source-map')) {
|
||||
return 'test';
|
||||
} */
|
||||
}
|
||||
|
||||
if (id.includes(`${sep}node_modules${sep}`)) {
|
||||
return 'vendor';
|
||||
|
@ -62,14 +58,18 @@ const bundle = {
|
|||
return 'main';
|
||||
}
|
||||
|
||||
if (flag_debug) {
|
||||
console.log('file does not belong to any chunk:', id);
|
||||
if (id.includes(process.env['HOME'])) {
|
||||
return 'linked';
|
||||
}
|
||||
|
||||
if (id.length === 30 && id.match(/^[a-f0-9]+$/)) {
|
||||
return 'vendor';
|
||||
}
|
||||
|
||||
if (flag_debug) {
|
||||
console.log('file does not belong to any chunk:', id);
|
||||
}
|
||||
|
||||
return 'nochunk';
|
||||
},
|
||||
output: {
|
||||
|
|
Loading…
Reference in New Issue