Skip to content

Commit

Permalink
fix(core): ensure createPackageJson sorts dependencies consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
skrtheboss committed May 26, 2022
1 parent 844679e commit ad38a07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/workspace/src/utilities/create-package-json.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ProjectGraph } from '@nrwl/devkit';
import { readJsonFile } from '@nrwl/devkit';
import { sortObjectByKeys } from 'nx/src/utils/object-sort';

/**
* Creates a package.json in the output directory for support to install dependencies within containers.
Expand Down Expand Up @@ -41,6 +42,9 @@ export function createPackageJson(
}
});

packageJson.devDependencies &&= sortObjectByKeys(packageJson.devDependencies);
packageJson.dependencies &&= sortObjectByKeys(packageJson.dependencies);

return packageJson;
}

Expand Down

0 comments on commit ad38a07

Please sign in to comment.