Skip to content

Commit 31840ed

Browse files
author
Walker Leite
committed
feat(gulp): add build:index
1 parent 982f0eb commit 31840ed

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

template/gulp-tasks/build.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,27 @@ gulp.task('build:common', () => {
7474
.pipe(gulp.dest(dirs.buildCommon));
7575
});
7676

77-
gulp.task('build:server', ['copy:server'], () => gulp.src([
78-
path.resolve(dirs.srcServer, '**/*.js'),
79-
path.resolve(dirs.root, 'index.js'),
80-
])
77+
gulp.task('build:server', ['copy:server'], () => {
78+
return gulp.src(path.resolve(dirs.srcServer, '**/*.js'))
8179
.pipe(sourcemaps.init())
8280
.pipe(babel())
8381
.pipe(sourcemaps.write('.'))
84-
.pipe(gulp.dest(dirs.buildServer)));
82+
.pipe(gulp.dest(dirs.buildServer));
83+
});
84+
85+
gulp.task('build:index', () => {
86+
return gulp.src(path.resolve(dirs.root, 'index.js'))
87+
.pipe(sourcemaps.init())
88+
.pipe(babel())
89+
.pipe(sourcemaps.write('.'))
90+
.pipe(gulp.dest(dirs.build));
91+
});
8592

8693
gulp.task('build', [
8794
'build:test',
8895
'build:client',
8996
'build:common',
9097
'build:server',
98+
'build:index',
9199
'copy:package',
92100
]);

0 commit comments

Comments
 (0)