diff --git a/packages/cra-template-typescript/package.json b/packages/cra-template-typescript/package.json index daf0693456e..4c16d0c0a3a 100644 --- a/packages/cra-template-typescript/package.json +++ b/packages/cra-template-typescript/package.json @@ -8,7 +8,6 @@ "typescript" ], "description": "The base TypeScript template for Create React App.", - "main": "template.json", "repository": { "type": "git", "url": "https://github.com/facebook/create-react-app.git", diff --git a/packages/cra-template/package.json b/packages/cra-template/package.json index b8fd4b871fc..f28004102ff 100644 --- a/packages/cra-template/package.json +++ b/packages/cra-template/package.json @@ -7,7 +7,6 @@ "template" ], "description": "The base template for Create React App.", - "main": "template.json", "repository": { "type": "git", "url": "https://github.com/facebook/create-react-app.git", diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index fdc4e0ae624..603bce3991f 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -106,9 +106,11 @@ module.exports = function( return; } - const templatePath = path.join( - require.resolve(templateName, { paths: [appPath] }), - '..' + const templatePath = path.dirname( + path.join( + require.resolve(`templateName/package.json`, { paths: [appPath] }), + '..' + ) ); let templateJsonPath;