URL Generation for Universal Router.
npm install universal-router-typesafe-urls
Run the following command to generate router class in watch mode (useful for development):
npx universal-router-typesafe-urls
Run the following command to generate router class once (useful for CI/CD):
npx universal-router-typesafe-urls --no-watch
You can set options in universal-router-typesafe-urls.config for your specific project. Available options:
key | type | default value |
---|---|---|
baseDir | string |
'' |
outputClassName | string |
'Router' |
outputClassPath | string |
'Router.ts' |
Defines which directory is the root to search universal-router definition. It's probably 'src' in most cases.
Defines name of class which will be used by you to generate routing urls.
Defines path of generated class.