1
0
Fork 0

fix(build): add chunk for linked modules to fix cyclical imports, sort test modules into test chunk

This commit is contained in:
ssube 2020-06-30 08:03:35 -05:00
parent 3361099729
commit bc06121a18
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 9 additions and 8 deletions

View File

@ -2,6 +2,7 @@
"names": [
"async_hooks",
"chai",
"fs",
"js-yaml",
"sinon"
]

View File

@ -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: {