-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
50 lines (41 loc) · 1.09 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
50
var gulp = require('gulp');
var clean = require('gulp-clean');
var stylus = require('gulp-stylus');
var babel = require('gulp-babel');
var bases = {
app: 'src/',
dist: 'dist/',
vendors: 'dist/vendors/',
css: 'dist/css/',
js: 'dist/js/'
};
gulp.task('clean', function() {
return gulp.src(bases.vendors).pipe(clean());
});
gulp.task('copy', ['clean'], function() {
gulp.src(
['material.js','material.css'],
{cwd: 'node_modules/material-design-lite/dist'}
).pipe(gulp.dest(bases.vendors));
gulp.src(
['vue.js'],
{cwd: 'node_modules/vue/dist'}
).pipe(gulp.dest(bases.vendors));
gulp.src(
['vue-router.js'],
{cwd: 'node_modules/vue-router/dist'}
).pipe(gulp.dest(bases.vendors));
});
gulp.task('css', function() {
gulp.src(['main.styl'], {cwd: bases.app})
.pipe(stylus())
.pipe(gulp.dest(bases.css));
});
gulp.task('js', function() {
gulp.src(['js/*.js'], {cwd: bases.app})
.pipe(babel({
presets: ['env']
}))
.pipe(gulp.dest(bases.js));
});
gulp.task('default', ['copy', 'css']);