Create a library for a NestJS API in a Nx Workspace

InstructorBram Borggreve

Share this video with your friends

Send Tweet

In this lesson we use the @nrwl/nest plugin to create a new library called core.

This is done by running the lib schematic from the @nrwl/nest plugin.

Once this library is generated, we import the it in the AppModule in order to register it.

If we look at the server output, we see that the CoreModule can not be loaded, failing with an error message "Module not found".

This is because changes in tsconfig are not being read until we restart the server. After restarting the server our CoreModule gets loaded correctly.