-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (37 loc) · 1.24 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
const gulp = require('gulp');
const browserify = require('browserify');
const babelify = require('babelify');
const source = require('vinyl-source-stream');
const uglify = require('gulp-uglify');
const buffer = require('vinyl-buffer');
const sourcemaps = require('gulp-sourcemaps');
const cleanCSS = require('gulp-clean-css');
const autoprefixer = require('gulp-autoprefixer');
const minify = require("gulp-minify");
babelify.configure({
babelrc: './.babelrc'
});
gulp.task('scripts', function () {
return browserify({ entries: 'API/wwwroot/scripts/script.js', extensions: ['.js'], debug: false })
.transform(babelify)
.bundle()
.pipe(source('script.js'))
.pipe(buffer())
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(minify({
noSource: true,
ext: {
min: '.js'
},
}))
.pipe(sourcemaps.write(''))
.pipe(gulp.dest('client-build/scripts/'));
});
gulp.task("styles", function () {
return gulp.src('API/wwwroot/styles/style.css')
.pipe(cleanCSS())
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9'))
.pipe(gulp.dest('client-build/styles/'));
});
gulp.task('default', ['scripts', 'styles']);