-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
37 lines (31 loc) · 983 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
const gulp = require('gulp')
const gutil = require('gulp-util')
const sass = require('gulp-sass')
const rename = require('gulp-rename')
const webpack = require('webpack')
const devWebpackCfg = require('./build/webpack.dev.js')
gulp.task('build:js', function (callback) {
webpack(devWebpackCfg, function (err, status) {
if (err) {
throw new gutil.PluginError('webpack', err)
}
gutil.log('[webpack]', status.toString())
callback()
})
})
gulp.task('build:sass', function () {
gulp.src('./src/styles/index.scss')
.pipe(sass())
.pipe(rename('vueantd.css'))
.pipe(gulp.dest('dist/styles'))
})
gulp.task('build:font', function () {
gulp.src('./src/styles/fonts/**')
.pipe(gulp.dest('dist/styles/fonts'))
})
gulp.task('build', ['build:js', 'build:sass', 'build:font'])
gulp.task('default', function () {
gulp.start('build')
gulp.watch('./src/styles/**/*', ['build:sass'])
gulp.watch('./src/components/**/*', ['build:js'])
})