Nx: how to override Nx default config template files

Created on 2 Jun 2019  路  2Comments  路  Source: nrwl/nx

Expected Behavior

I'd like to override the default template files provided by Nx schematics.

As per example, when creating new library, I need to provide customized properties in karma.conf.js so this is why I'm asking if I can provide my own template file to override karma.conf.js__tmpl__ file, which is the default one.

Current Behavior

Seems to be impossible in version 7.3+

question / discussion

Most helpful comment

Yes, we recommend you look at Workspace Schematics: https://auth0.com/blog/create-custom-schematics-with-nx/.

With this you can define your own set of schematics. Which can help your organization enforce it's own best practices. Unfortunately we do not have the best documentation on it but I hope to provide some soon.

All 2 comments

looks like possible by extending the existing collection of schematics with the extends property but I would have thought of something more configurable. What do you guys think?

Yes, we recommend you look at Workspace Schematics: https://auth0.com/blog/create-custom-schematics-with-nx/.

With this you can define your own set of schematics. Which can help your organization enforce it's own best practices. Unfortunately we do not have the best documentation on it but I hope to provide some soon.

Was this page helpful?
0 / 5 - 0 ratings