Create-react-app: Template dependencies

Created on 30 Jun 2017  路  2Comments  路  Source: facebook/create-react-app

Hi! I've forked create-react-app to customise the template, due to having to start a lot of different small apps that share some dependencies (redux, etc.) and they work in very similar ways... is there any way of including template dependencies to be added to the generated package.json? That is not replacing this line (263) in createReactApp.js: const allDependencies = ['react', 'react-dom', packageToInstall];? What it the templateDependenciesPath constant in the init.js (line 107) being used for? Thanks!!!

Most helpful comment

@yakhinvadim check my fork here. Basically I created the file .template.dependencies.json, and as you can see in the line 130 of the init.js script I'm spawning the yarn/npm install command to install all of the dependencies specified in that file.

Next step is to add a new script that takes care of the precommit stuff so I can remove lint-staged, husky and prettier from the generated package.json and handle it from a react-scripts precommit script.

All 2 comments

@xavifuefer, Have you figured that out? I'm having the same questions.

@yakhinvadim check my fork here. Basically I created the file .template.dependencies.json, and as you can see in the line 130 of the init.js script I'm spawning the yarn/npm install command to install all of the dependencies specified in that file.

Next step is to add a new script that takes care of the precommit stuff so I can remove lint-staged, husky and prettier from the generated package.json and handle it from a react-scripts precommit script.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adrice727 picture adrice727  路  3Comments

Aranir picture Aranir  路  3Comments

fson picture fson  路  3Comments

oltsa picture oltsa  路  3Comments

barcher picture barcher  路  3Comments