Skip to content

Commit 5ba3734

Browse files
committed
fix: Add start script for apps
1 parent ee8e6e6 commit 5ba3734

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

packages/cli/generators/project/templates/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
<% if (project.prettier || project.tslint) { -%>
4141
"posttest": "npm run lint",
4242
<% } -%>
43+
<% if (project.projectType === 'application') { -%>
44+
"start": "npm run build && node .",
45+
<% } -%>
4346
"prepare": "npm run build"
4447
},
4548
"repository": {

packages/cli/generators/project/templates/package.plain.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
<% if (project.prettier || project.tslint) { -%>
4141
"posttest": "npm run lint",
4242
<% } -%>
43+
<% if (project.projectType === 'application') { -%>
44+
"start": "npm run build && node .",
45+
<% } -%>
4346
"prepare": "npm run build"
4447
},
4548
"repository": {

packages/cli/test/project.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,19 @@ module.exports = function(projGenerator, props, projectType) {
5656
assert.fileContent('package.json', '"@loopback/core"');
5757
assert.fileContent('package.json', '"@loopback/context"');
5858
assert.fileContent('package.json', '"@loopback/rest"');
59+
assert.jsonFileContent('package.json', {
60+
scripts: {
61+
start: 'npm run build && node .',
62+
},
63+
});
5964
}
6065
if (projectType === 'extension') {
6166
assert.fileContent('package.json', '"@loopback/core"');
6267
assert.fileContent('package.json', '"@loopback/context"');
6368
assert.noFileContent('package.json', '"@loopback/rest"');
69+
assert.noJsonFileContent('package.json', {
70+
start: 'npm run build && node .',
71+
});
6472
}
6573
});
6674
});

0 commit comments

Comments
 (0)