forked from ubik23/charactercreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (40 loc) · 1.29 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var concat = require('gulp-concat');
var autoprefixer = require('autoprefixer');
var postcss = require('gulp-postcss');
var sourcemaps = require('gulp-sourcemaps');
var minify = require('gulp-minify');
var cleanCSS = require('gulp-clean-css');
var watch = require('gulp-watch');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
gulp.task('default',function() {
gulp.watch('src/sass/**/*.scss',['sass']);
gulp.watch('src/js/**/*.js',['scripts']);
browserSync.init({
server: {
baseDir: "./target/"
}
});
});
gulp.task('scripts', function() {
return gulp.src(['./src/lib/*.js', './src/js/*.js'])
.pipe(concat('all.js'))
.pipe(minify({
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
}))
.pipe(gulp.dest('./target/dist/'));
});
gulp.task('sass', function () {
gulp.src('src/sass/**/*.scss')
.pipe(sass())
//.pipe(gulp.dest('css'))
.pipe(concat('styles.css'))
.pipe(sourcemaps.init())
.pipe(postcss([ autoprefixer({ browsers: ['last 2 versions'] }) ]))
.pipe(sourcemaps.write('.'))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('./target/css/'));
});