-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (39 loc) · 1.17 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
var postcss = require('gulp-postcss');
var gulp = require('gulp');
var minify = require('gulp-minify');
gulp.task('css', function () {
return gulp.src('./assets/postcss/app.css')
.pipe(postcss([
require('postcss-partial-import'),
require('autoprefixer'),
require('precss'),
require('postcss-nested'),
require('postcss-css-variables')
]))
.pipe(gulp.dest('./wwwroot/css/'));
});
gulp.task('js', function() {
gulp.src('assets/js/*.js')
.pipe(minify({
ext:{
min: '.min.js'
},
noSource: true
}))
.pipe(gulp.dest('./wwwroot/js/'))
})
gulp.task('vendor', function() {
//Font Awesome
gulp.src('node_modules/font-awesome/fonts/*')
.pipe(gulp.dest('wwwroot/fonts/'));
gulp.src('node_modules/font-awesome/css/font-awesome.min.css')
.pipe(gulp.dest('wwwroot/css/'));
//JQuery
gulp.src('node_modules/jquery/dist/jquery.min.js')
.pipe(gulp.dest('wwwroot/js/'));
});
gulp.task('watch', function() {
gulp.watch('assets/postcss/*', ['css'])
gulp.watch('assets/js/*', ['js'])
});
gulp.task('init', ['vendor', 'css', 'js']);