Skip to content

Commit bb7ff69

Browse files
authored
Make sure to set unique key (fix) (#9326)
* forgot to readd in uniquekey * add tests
1 parent 060561e commit bb7ff69

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/bundlers/default/src/DefaultBundler.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ function createIdealGraph(
776776
manualSharedMap.set(manualSharedBundleKey, bundleId);
777777
}
778778
bundle.manualSharedBundle = manualSharedObject.name;
779+
bundle.uniqueKey = manualSharedObject.name + childAsset.type;
779780
}
780781
}
781782
}

packages/core/integration-tests/test/bundler.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
fsFixture,
1010
run,
1111
} from '@parcel/test-utils';
12+
import {hashString} from '@parcel/rust';
1213

1314
describe('bundler', function () {
1415
it('should not create shared bundles when a bundle is being reused and disableSharedBundles is enabled', async function () {
@@ -1520,6 +1521,10 @@ describe('bundler', function () {
15201521
assets: ['math.js', 'add.js', 'subtract.js'],
15211522
},
15221523
]);
1524+
1525+
let targetDistDir = __dirname.replace('/test', '/dist');
1526+
let hashedIdWithMSB = hashString('bundle:' + 'vendorjs' + targetDistDir);
1527+
assert(b.getBundles().find(b => b.id == hashedIdWithMSB));
15231528
});
15241529

15251530
it('should support manual shared bundles with constants module', async function () {
@@ -1655,6 +1660,10 @@ describe('bundler', function () {
16551660
},
16561661
]);
16571662

1663+
let targetDistDir = __dirname.replace('/test', '/dist');
1664+
let hashedIdWithMSB = hashString('bundle:' + 'vendorjs' + targetDistDir);
1665+
assert(b.getBundles().find(b => b.id == hashedIdWithMSB));
1666+
16581667
await run(b);
16591668
});
16601669

0 commit comments

Comments
 (0)