Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed May 16, 2023
1 parent f290b84 commit 3ac2750
Show file tree
Hide file tree
Showing 23 changed files with 177 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils/chunkAssignment.ts
Expand Up @@ -538,9 +538,7 @@ function getOptimizedChunks(
chunkPartition.small.size,
'were below minChunkSize.'
);
if (chunkPartition.small.size > 0) {
mergeChunks(chunkPartition, minChunkSize);
}
mergeChunks(chunkPartition, minChunkSize);
minChunkSize > 1 &&
console.log(
'After merging chunks,\n',
Expand Down
@@ -0,0 +1,9 @@
module.exports = defineTest({
description: 'avoids circular dependencies when merging chunks',
options: {
input: ['main1.js', 'main2.js', 'main3.js'],
output: {
experimentalMinChunkSize: 100
}
}
});
@@ -0,0 +1,19 @@
define(['exports'], (function (exports) { 'use strict';

const second = 1;

const shared = second + 'shared';

const main1 = 1;

const main2 = 2;

const main3 = 3;

exports.main1 = main1;
exports.main2 = main2;
exports.main3 = main3;
exports.second = second;
exports.shared = shared;

}));
@@ -0,0 +1,9 @@
define(['exports', './generated-main3'], (function (exports, main1) { 'use strict';



exports.main1 = main1.main1;
exports.second = main1.second;
exports.shared = main1.shared;

}));
@@ -0,0 +1,8 @@
define(['exports', './generated-main3'], (function (exports, main1) { 'use strict';



exports.main2 = main1.main2;
exports.shared = main1.shared;

}));
@@ -0,0 +1,8 @@
define(['exports', './generated-main3'], (function (exports, main1) { 'use strict';



exports.main3 = main1.main3;
exports.second = main1.second;

}));
@@ -0,0 +1,17 @@
'use strict';

const second = 1;

const shared = second + 'shared';

const main1 = 1;

const main2 = 2;

const main3 = 3;

exports.main1 = main1;
exports.main2 = main2;
exports.main3 = main3;
exports.second = second;
exports.shared = shared;
@@ -0,0 +1,9 @@
'use strict';

var main1 = require('./generated-main3.js');



exports.main1 = main1.main1;
exports.second = main1.second;
exports.shared = main1.shared;
@@ -0,0 +1,8 @@
'use strict';

var main1 = require('./generated-main3.js');



exports.main2 = main1.main2;
exports.shared = main1.shared;
@@ -0,0 +1,8 @@
'use strict';

var main1 = require('./generated-main3.js');



exports.main3 = main1.main3;
exports.second = main1.second;
@@ -0,0 +1,11 @@
const second = 1;

const shared = second + 'shared';

const main1 = 1;

const main2 = 2;

const main3 = 3;

export { second as a, main2 as b, main3 as c, main1 as m, shared as s };
@@ -0,0 +1 @@
export { m as main1, a as second, s as shared } from './generated-main3.js';
@@ -0,0 +1 @@
export { b as main2, s as shared } from './generated-main3.js';
@@ -0,0 +1 @@
export { c as main3, a as second } from './generated-main3.js';
@@ -0,0 +1,18 @@
System.register([], (function (exports) {
'use strict';
return {
execute: (function () {

const second = exports('a', 1);

const shared = exports('s', second + 'shared');

const main1 = exports('m', 1);

const main2 = exports('b', 2);

const main3 = exports('c', 3);

})
};
}));
@@ -0,0 +1,13 @@
System.register(['./generated-main3.js'], (function (exports) {
'use strict';
return {
setters: [function (module) {
exports({ main1: module.m, second: module.a, shared: module.s });
}],
execute: (function () {



})
};
}));
@@ -0,0 +1,13 @@
System.register(['./generated-main3.js'], (function (exports) {
'use strict';
return {
setters: [function (module) {
exports({ main2: module.b, shared: module.s });
}],
execute: (function () {



})
};
}));
@@ -0,0 +1,13 @@
System.register(['./generated-main3.js'], (function (exports) {
'use strict';
return {
setters: [function (module) {
exports({ main3: module.c, second: module.a });
}],
execute: (function () {



})
};
}));
@@ -0,0 +1,3 @@
export { shared } from './shared';
export { second } from './second';
export const main1 = 1;
@@ -0,0 +1,2 @@
export { shared } from './shared';
export const main2 = 2;
@@ -0,0 +1,2 @@
export { second } from './second';
export const main3 = 3;
@@ -0,0 +1 @@
export const second = 1;
@@ -0,0 +1,2 @@
import { second } from './second';
export const shared = second + 'shared';

0 comments on commit 3ac2750

Please sign in to comment.