From 3402bd624d3ebe7b84ac208e22b5bdd527da886e Mon Sep 17 00:00:00 2001 From: Kevin Old Date: Thu, 5 Dec 2019 13:15:58 -0600 Subject: [PATCH 1/2] Update custom template docs with instructions for testing custom template locally --- docusaurus/docs/custom-templates.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docusaurus/docs/custom-templates.md b/docusaurus/docs/custom-templates.md index 98acb9b1a75..46963c96d81 100644 --- a/docusaurus/docs/custom-templates.md +++ b/docusaurus/docs/custom-templates.md @@ -50,6 +50,14 @@ my-app/ index.js (or index.tsx) ``` +### Testing a template + +To test a template locally, pass the file path to the directory of your template source using the `file:` prefix. + +```sh +yarn create react-app my-app --template file:../path/to/your/template/cra-template-[template-name] +``` + ### The `template` folder This folder is copied to the user's app directory as Create React App installs. During this process, the file `gitignore` is renamed to `.gitignore`. From 42357901917bd3582b91a5ace388cf738ebdeafa Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Thu, 30 Jan 2020 14:44:00 -0800 Subject: [PATCH 2/2] Update custom-templates.md --- docusaurus/docs/custom-templates.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docusaurus/docs/custom-templates.md b/docusaurus/docs/custom-templates.md index 46963c96d81..cb43ffe5333 100644 --- a/docusaurus/docs/custom-templates.md +++ b/docusaurus/docs/custom-templates.md @@ -9,16 +9,8 @@ Custom Templates enable you to select a template to create your project from, wh You'll notice that Custom Templates are always named in the format `cra-template-[template-name]`, however you only need to provide the `[template-name]` to the creation command. -### npm - -```sh -npm init react-app my-app --template [template-name] -``` - -### Yarn - ```sh -yarn create react-app my-app --template [template-name] +npx create-react-app my-app --template [template-name] ``` ## Finding custom templates @@ -55,7 +47,7 @@ my-app/ To test a template locally, pass the file path to the directory of your template source using the `file:` prefix. ```sh -yarn create react-app my-app --template file:../path/to/your/template/cra-template-[template-name] +npx create-react-app my-app --template file:../path/to/your/template/cra-template-[template-name] ``` ### The `template` folder