<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
## Current Behavior
Using example code directly will result in an error because a
`PackageJson` object cannot be parsed to the `writeFileSync` function.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Replace the `writeFileSync` fn with the `writeJsonFile` fn from
'@nx/devkit'