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
+20-7
Original file line number
Diff line number
Diff line change
@@ -60,18 +60,31 @@ You can add whatever files you want in here, but you must have at least the file
60
60
61
61
### The `template.json` file
62
62
63
-
This is where you can define dependencies (only dependencies are supported for now), as well as any custom scripts that your template relies on.
63
+
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.
64
+
65
+
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.
66
+
67
+
Below is an example `template.json` file:
64
68
65
69
```json
66
70
{
67
-
"dependencies": {
68
-
"serve": "^11.2.0"
69
-
},
70
-
"scripts": {
71
-
"serve": "serve -s build",
72
-
"build-and-serve": "npm run build && npm run serve"
71
+
"package": {
72
+
"dependencies": {
73
+
"eslint-plugin-jsx-a11y": "^6.2.3",
74
+
"serve": "^11.2.0"
75
+
},
76
+
"scripts": {
77
+
"serve": "serve -s build",
78
+
"build-and-serve": "npm run build && npm run serve"
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.
89
+
77
90
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