Skip to content

Commit 527e061

Browse files
author
Walker Leite
committed
feat(gulp): add package to built file and add start script
1 parent 8b21fc5 commit 527e061

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

template/gulp-tasks/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ gulp.task('build:common', () => {
7676
.pipe(gulp.dest(dirs.buildCommon));
7777
});
7878

79-
gulp.task('build:server', () => {
79+
gulp.task('build:server', ['copy:server'], () => {
8080
return gulp.src(path.resolve(dirs.srcServer, '**/*.js'))
8181
.pipe(sourcemaps.init())
8282
.pipe(babel())

template/gulp-tasks/copy.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ gulp.task('copy:client', ['copy:client:fa'], function() {
1111
return gulp.src(dirs.srcClient + '/**/!(*.vue|*.js)')
1212
.pipe(gulp.dest(path.resolve(dirs.buildClient)));
1313
});
14+
15+
gulp.task('copy:package', function () {
16+
return gulp.src(dirs.root + '/package.json')
17+
.pipe(gulp.dest(path.resolve(dirs.build)));
18+
});
19+
20+
gulp.task('copy:server', function () {
21+
return gulp.src(dirs.srcServer + '/**/*.json')
22+
.pipe(gulp.dest(path.resolve(dirs.buildServer)));
23+
});

template/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"main": "server/server.js",
55
"engines": {
6-
"node": ">=4"
6+
"node": ">=8.9.4"
77
},
88
"scripts": {
99
"lint": "eslint .",
@@ -12,12 +12,14 @@
1212
"test": "gulp test",
1313
"test:server": "gulp test:server",
1414
"test:client": "gulp test:client",
15+
"start": "node build/server/server.js & http-server build/client",
1516
"vulnerabilities": "nsp check"
1617
},
1718
"dependencies": {
1819
"compression": "^1.0.3",
1920
"cors": "^2.5.2",
2021
"helmet": "^1.3.0",
22+
"http-server": "^0.11.1",
2123
"loopback": "^3.16.2",
2224
"loopback-boot": "^2.27.0",
2325
"loopback-component-explorer": "^4.0.0",

0 commit comments

Comments
 (0)