-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (29 loc) · 1003 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var gulp = require('gulp');
var rename = require( 'gulp-rename' );
var clean = require('gulp-clean');
gulp.task('clean-files', function () {
return gulp.src('./build/*.js',{read:false})
.pipe(clean({force:true}));
});
gulp.task('clean-prebuild', function () {
return gulp.src('./prebuild/*.js',{read:false})
.pipe(clean({force:true}));
});
gulp.task('javascript', function () {
gulp.src('./dist/*.js')
.pipe(gulp.dest('./prebuild/'))
.pipe(rename(function (path) {
var newName = path.basename.split(".");
path.basename = newName[0];
}))
.pipe(gulp.dest('./build/'))
});
gulp.task('build', ['clean-files','javascript','clean-prebuild']);
// gulp.task('rename-files', function () {
// return gulp.src('./build/*.js')
// .pipe(rename(function (path) {
// var newName = path.basename.split(".");
// path.basename = newName[0];
// }))
// .pipe(gulp.dest('./build/'));
// });