diff --git a/packages/cli/generators/project/templates/package.json.ejs b/packages/cli/generators/project/templates/package.json.ejs index 2f78ff2fd403..3b2847d78687 100644 --- a/packages/cli/generators/project/templates/package.json.ejs +++ b/packages/cli/generators/project/templates/package.json.ejs @@ -71,10 +71,15 @@ "src", "!*/__tests__" ], +<% if (project.projectType === 'extension') { -%> + "peerDependencies": { + "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>" + }, +<% } -%> "dependencies": { +<% if (project.projectType === 'application') { -%> "@loopback/boot": "<%= project.dependencies['@loopback/boot'] -%>", "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", -<% if (project.projectType === 'application') { -%> <% if (project.repositories) { -%> "@loopback/repository": "<%= project.dependencies['@loopback/repository'] -%>", <% } -%> @@ -94,6 +99,9 @@ "devDependencies": { "@loopback/build": "<%= project.dependencies['@loopback/build'] -%>", "source-map-support": "<%= project.dependencies['source-map-support'] -%>", +<% if (project.projectType === 'extension') { -%> + "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", +<% } -%> "@loopback/testlab": "<%= project.dependencies['@loopback/testlab'] -%>", "@types/node": "<%= project.dependencies['@types/node'] -%>", <% if (project.eslint) { -%> diff --git a/packages/cli/generators/project/templates/package.plain.json.ejs b/packages/cli/generators/project/templates/package.plain.json.ejs index c7eb25dc0b75..20b2b4e6c3c7 100644 --- a/packages/cli/generators/project/templates/package.plain.json.ejs +++ b/packages/cli/generators/project/templates/package.plain.json.ejs @@ -71,10 +71,15 @@ "src", "!*/__tests__" ], +<% if (project.projectType === 'extension') { -%> + "peerDependencies": { + "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>" + }, +<% } -%> "dependencies": { +<% if (project.projectType === 'application') { -%> "@loopback/boot": "<%= project.dependencies['@loopback/boot'] -%>", "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", -<% if (project.projectType === 'application') { -%> "@loopback/repository": "<%= project.dependencies['@loopback/repository'] -%>", <% if (project.apiconnect) { -%> "@loopback/apiconnect": "<%= project.dependencies['@loopback/apiconnect'] -%>", @@ -87,6 +92,9 @@ "devDependencies": { "rimraf": "<%= project.dependencies['rimraf'] -%>", "source-map-support": "<%= project.dependencies['source-map-support'] -%>", +<% if (project.projectType === 'extension') { -%> + "@loopback/core": "<%= project.dependencies['@loopback/core'] -%>", +<% } -%> "@loopback/testlab": "<%= project.dependencies['@loopback/testlab'] -%>", <% if (project.mocha) { -%> "@types/mocha": "<%= project.dependencies['@types/mocha'] -%>",