diff --git a/packages/workspace/package.json b/packages/workspace/package.json index 4dc947e5155ee..64dda344701a7 100644 --- a/packages/workspace/package.json +++ b/packages/workspace/package.json @@ -2,6 +2,9 @@ "name": "@nrwl/workspace", "version": "0.0.1", "description": "Smart, Fast and Extensible Build System", + "scripts": { + "postinstall": "node ./src/init/init" + }, "repository": { "type": "git", "url": "https://github.com/nrwl/nx.git", diff --git a/packages/workspace/src/init/init.ts b/packages/workspace/src/init/init.ts new file mode 100644 index 0000000000000..15164c12b6ace --- /dev/null +++ b/packages/workspace/src/init/init.ts @@ -0,0 +1,9 @@ +import { createProjectGraphAsync } from '../core/project-graph/project-graph'; + +(async () => { + try { + await createProjectGraphAsync(); + } catch (e) { + // Do not error since this runs in a postinstall + } +})();