You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docusaurus/docs/custom-templates.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,28 +58,31 @@ You can add whatever files you want in here, but you must have at least the file
58
58
59
59
### The `template.json` file
60
60
61
-
This is the configuration file for your template. It allows you to define information that should become a part of the generated project's `package.json` file, such as dependencies (only dependencies are supported for now) and any custom scripts that your template relies on. It should be structured as follows:
61
+
This is the configuration file for your template. As this is a new feature, more options will be added over time. For now, only a `package` key is supported.
62
+
63
+
The `package` key lets you provide any keys/values that you want added to the new project's `package.json`, such as dependencies (only dependencies are supported for now) and any custom scripts that your template relies on.
64
+
65
+
Below is an example `template.json` file:
62
66
63
67
```json
64
68
{
65
69
"package": {
66
70
"dependencies": {
71
+
"eslint-plugin-jsx-a11y": "^6.2.3",
67
72
"serve": "^11.2.0"
68
73
},
69
74
"scripts": {
70
75
"serve": "serve -s build",
71
76
"build-and-serve": "npm run build && npm run serve"
Any values you add for `"dependencies"` and `"scripts"` will be merged with the values used in the initialisation process of `react-scripts`. Any other information you add to `"package"`will be added to the generated project's `package.json` file, replacing any existing values associated with those keys.
86
+
Any values you add for `"dependencies"` and `"scripts"` will be merged with the Create React App defaults. Values for any other keys will be used as-is, replacing any matching Create React App defaults.
84
87
85
88
For convenience, we always replace `npm run` with `yarn` in your custom `"scripts"`, as well as in your `README` when projects are initialized with yarn.
0 commit comments