Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure to set unique key (fix) #9326

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/bundlers/default/src/DefaultBundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ function createIdealGraph(
manualSharedMap.set(manualSharedBundleKey, bundleId);
}
bundle.manualSharedBundle = manualSharedObject.name;
bundle.uniqueKey = manualSharedObject.name + childAsset.type;
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions packages/core/integration-tests/test/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
fsFixture,
run,
} from '@parcel/test-utils';
import {hashString} from '@parcel/rust';

describe('bundler', function () {
it('should not create shared bundles when a bundle is being reused and disableSharedBundles is enabled', async function () {
Expand Down Expand Up @@ -1520,6 +1521,10 @@ describe('bundler', function () {
assets: ['math.js', 'add.js', 'subtract.js'],
},
]);

let targetDistDir = __dirname.replace('/test', '/dist');
let hashedIdWithMSB = hashString('bundle:' + 'vendorjs' + targetDistDir);
assert(b.getBundles().find(b => b.id == hashedIdWithMSB));
});

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

let targetDistDir = __dirname.replace('/test', '/dist');
let hashedIdWithMSB = hashString('bundle:' + 'vendorjs' + targetDistDir);
assert(b.getBundles().find(b => b.id == hashedIdWithMSB));

await run(b);
});

Expand Down