forked from realshadow/satis-control-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (44 loc) · 1.32 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
var gulp = require('gulp');
var less = require('gulp-less');
var typescript = require('gulp-typescript');
var watch = require('gulp-watch');
var concat = require('gulp-concat');
var livereload = require('gulp-livereload');
var sourcemaps = require('gulp-sourcemaps');
var tsProject = typescript.createProject('./tsconfig.json', { sortOutput: true });
var paths = {
'less': {
'input': './resources/assets/less',
'output': './public/control-panel/css'
},
'ts': {
'input': './resources/assets/typescript',
'output': './public/control-panel/js',
'output_file': 'bundle.js'
}
};
gulp.task('less', function() {
return gulp.src(paths.less.input + '/app.less')
.pipe(sourcemaps.init())
.pipe(less())
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.less.output))
.pipe(livereload());
});
/*
gulp.task('ts', function() {
return tsProject.src()
.pipe(sourcemaps.init())
.pipe(typescript(tsProject))
.js
.pipe(concat('bundle.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.ts.output));
});
*/
gulp.task('watch', function() {
gulp.watch([paths.less.input + '/*.less'], ['less']);
//gulp.watch([paths.ts.input + '/*.ts'], ['ts']);
});
gulp.task('default', ['watch']);
gulp.task('init', ['less']);