fix(bundling): fix regression with --thirdParty option for esbuild (#19835)
This commit is contained in:
parent
8932b069f5
commit
75062ef4e8
@ -156,6 +156,13 @@ describe('EsBuild Plugin', () => {
|
|||||||
// Bundle only child lib
|
// Bundle only child lib
|
||||||
runCLI(`build ${parentLib} --third-party=false`);
|
runCLI(`build ${parentLib} --third-party=false`);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
readJson(`dist/libs/${parentLib}/package.json`).dependencies
|
||||||
|
).toEqual({
|
||||||
|
// Don't care about the versions, just that they exist
|
||||||
|
rambda: expect.any(String),
|
||||||
|
lodash: expect.any(String),
|
||||||
|
});
|
||||||
runResult = runCommand(`node dist/libs/${parentLib}/index.cjs`);
|
runResult = runCommand(`node dist/libs/${parentLib}/index.cjs`);
|
||||||
expect(runResult).toMatch(/Hello world/);
|
expect(runResult).toMatch(/Hello world/);
|
||||||
expect(runResult).toMatch(/Hello from child lib/);
|
expect(runResult).toMatch(/Hello from child lib/);
|
||||||
|
|||||||
@ -87,6 +87,10 @@ export async function* esbuildExecutor(
|
|||||||
generateLockfile: true,
|
generateLockfile: true,
|
||||||
outputFileExtensionForCjs: getOutExtension('cjs', options),
|
outputFileExtensionForCjs: getOutExtension('cjs', options),
|
||||||
excludeLibsInPackageJson: !options.thirdParty,
|
excludeLibsInPackageJson: !options.thirdParty,
|
||||||
|
// TODO(jack): Remove the need to pass updateBuildableProjectDepsInPackageJson option when overrideDependencies or extraDependencies are passed.
|
||||||
|
// Add this back to fix a regression.
|
||||||
|
// See: https://github.com/nrwl/nx/issues/19773
|
||||||
|
updateBuildableProjectDepsInPackageJson: externalDependencies.length > 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
// If we're bundling third-party packages, then any extra deps from external should be the only deps in package.json
|
// If we're bundling third-party packages, then any extra deps from external should be the only deps in package.json
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user