fix(core): esbuild generateLockfile according to docs (#18413)

This commit is contained in:
Igor Loskutov 2023-08-01 20:29:38 +07:00 committed by GitHub
parent 48deaec60f
commit a5d6a293aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,10 @@ describe('EsBuild Plugin', () => {
expect(runCommand(`node dist/libs/${myPkg}/index.cjs`)).toMatch(/Hello/);
// main field should be set correctly in package.json
checkFilesExist(`dist/libs/${myPkg}/package.json`);
checkFilesExist(
`dist/libs/${myPkg}/package.json`,
`dist/libs/${myPkg}/pnpm-lock.yaml`
);
expect(runCommand(`node dist/libs/${myPkg}`)).toMatch(/Hello/);
expect(runCommand(`node dist/libs/${myPkg}/index.cjs`)).toMatch(/Hello/);

View File

@ -85,6 +85,7 @@ export async function* esbuildExecutor(
...options,
// TODO(jack): make types generate with esbuild
skipTypings: true,
generateLockfile: true,
outputFileExtensionForCjs: getOutExtension('cjs', options),
excludeLibsInPackageJson: !options.thirdParty,
updateBuildableProjectDepsInPackageJson: externalDependencies.length > 0,