How to create and use a custom template?
How do I create a template and how do I use it once it is created?
3 Replies
Hi @Ghar. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain information on how to create a custom template in Wasp. However, they do provide information on how to use existing templates when creating a new Wasp project.
To use an existing template when creating a new Wasp project, you can use the
wasp new
command in the interactive mode. This command will prompt you to input the project name and to select a template. The chosen template will then be used to generate the project directory with the specified name. Here is an example:
To skip the interactive mode and create a new Wasp project with the default template, you can use wasp new <project-name>
.
For more information, you can refer to the Wasp documentation (https://wasp-lang.dev/docs/project/starter-templates).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------Wasp doesn't currently support creating templates that you can use within the CLI e.g.
wasp new app -t my-template-name
You can always create a project that you copy paste every time you need to start with your custom setup.
There is also this thing called giget
which you can use to get some folder from some Github repo e.g. this is how I do it with my Typescript starter: npx giget gh:infomiho/typescript-starter my-project
which is located here: https://github.com/infomiho/typescript-starterGitHub
GitHub - infomiho/typescript-starter: Simple Typescript starter, ru...
Simple Typescript starter, run
npx degit infomiho/typescript-starter folder
- infomiho/typescript-startergreat tip 'giget' thanks