react-scripts/init: Template dependencies ignored
Created by: callummr
Is this a bug report?
I think so
Can you also reproduce the problem with npm 4.x?
N/A
Which terms did you search for in User Guide?
"template dependencies"
Environment
-
node -v
: 8.8.1 -
npm -v
: 5.4.2 -
yarn --version
(if you use Yarn): 1.2.1 -
npm ls react-scripts
(if you haven’t ejected): 1.0.14
Then, specify:
- Operating system: High Sierra
- Browser and version (if relevant): N/A
Steps to Reproduce
- Fork
create-react-app
- Add a
.template.dependencies.json
topackages/react-scripts/template
containing a dependencies object with at least one dependency - Run
yarn create-react-app test
Expected Behavior
Template dependencies are installed in the created 'test' app
Actual Behavior
Since react
and react-dom
are now installed by create-react-app
and not react-scripts/init
, the check to execute the dependency installation https://github.com/facebookincubator/create-react-app/blob/345f5508610a96e720b91785b49c7a934bbc477b/packages/react-scripts/scripts/init.js#L122 fails and template dependencies are ignored. I believe there needs to be a separate check in case any template dependencies do exist, to then install them. Happy to PR if agreed this is incorrect behaviour
Cheers!