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": [ "names": [
"async_hooks", "async_hooks",
"chai", "chai",
"fs",
"js-yaml", "js-yaml",
"sinon" "sinon"
] ]

View File

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