-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (33 loc) · 992 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
var gulp = require("gulp");
var browserify = require("gulp-browserify");
var uglify = require("gulp-uglify");
var rename = require("gulp-rename");
var sass = require("gulp-sass");
var sourcemaps = require("gulp-sourcemaps");
var autoprefixer = require("gulp-autoprefixer");
var modulePath = "./module/";
var buildPath = "./build/";
gulp.task('default', ['browserify', 'scss'], function(){
//
});
gulp.task('browserify', function(){
gulp.src(modulePath + "main.js")
.pipe(browserify())
.pipe(uglify())
.pipe(rename({
basename: 'bundle',
suffix: '.min'
}))
.pipe(gulp.dest(buildPath + 'js'));
});
gulp.task('scss', function(){
gulp.src('./scss/*.scss')
.pipe(sass())
.pipe(sourcemaps.init())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: true
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(buildPath + 'css'));
});